Commit Graph
271 Commits
Author SHA1 Message Date
baldurk fc39299da8 Don't require GL_OVR_multiview2 when GL_OVR_multiview is enough
* This is also all we check for in code.
2022-06-16 15:53:50 +01:00
baldurk 31feedd16d Remove ShaderConstantDescriptor, inline into ShaderConstantType
* This struct was redundant isnce it was only ever used in the type and not
  meaningfully accessed directly.
2022-05-20 14:15:31 +01:00
baldurk 788b408bc2 Add test for GL reflection & reconstruction of runtime arrays 2022-05-20 13:37:26 +01:00
baldurk 4e5e01e739 Improve consistency in shader constant reflection
* This reports the struct vartype now, ensures that struct sizes are always
  reported and alignments are respected, along with some other fixes to more
  accurately report memory layouts of structs.
2022-05-20 13:37:25 +01:00
baldurk cef00a102b Add struct VarType and combine flags into single field
* This is not a space saving right now, but allows more flags to be added
  without adding more storage.
2022-05-20 13:37:25 +01:00
Remi PalandriandBaldur Karlsson acde46de57 move ms/compute shader system to single descriptorset 2022-05-03 12:33:46 +01:00
baldurk cd10efb693 Fix some abstraction defines for custom shaders 2022-03-30 13:05:46 +01:00
baldurk 5076ab1b4d Allow easier switching between offline/online reflection for tests 2022-03-17 18:10:06 +00:00
Remi PalandriandBaldur Karlsson 79aee1df43 full implementation of compute msaa-to-buffer 2022-03-09 12:10:47 +00:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 4bf2e00ba5 Switch custom prefixes from defines to static constants 2022-02-01 01:07:25 +00:00
baldurk 3ac4bd0ebd Refactor custom shaders to abstract binding differences. Closes #2458
* Newly written shaders and any updated shaders can now use pre-defined macros
  to abstract away binding differences between APIs, so custom shaders will be
  more portable in particular shaders written in HLSL for D3D or GLSL on OpenGL
  won't break on vulkan because they refer to incorrect binds.
2022-01-31 19:14:08 +00:00
Jordan JustenandBaldur Karlsson 387d12db42 glsl_shaders: Update setEnvInput() call for non-SPIR-V GL shaders
Ref: https://github.com/KhronosGroup/glslang/issues/2872
Ref: https://github.com/KhronosGroup/glslang/commit/81cc10a498b25a90147cccd6e8939493c1e9e20e

After discussions with the glslang developers, it appears that the
parameters in glslang's setEnvInput() function are a bit more geared
towards SPIRV that the documentation implied.

After the glslang commit above, and discussions with the developer, it
seems that the 3rd parameter to setEnvInput() should only be set to
EShClientOpenGL if you want to enable the ARB_gl_spirv extension.

The 4th parameter to setEnvInput() is version, but it is used to
indicate the version of either the KHR_vulkan_glsl extention for
vulkan, or the ARB_gl_spirv extension for OpenGL with SPIR-V.

So, if the shader type is neither ShaderType::Vulkan, nor
ShaderType::GLSPIRV, we should specify glslang::EShClientNone for the
3rd parameter and 0 for the 4th parameter of setEnvInput().

This doesn't actually impact renderdoc with the currently bundled
glslang 8.13.3743, because they failed to pass the environment through
during pre-processing.

But, this changed in this glslang commit in 11.2.0:

 * 6274ec5c ("Pass environment through PreprocessDeferred")
 * https://github.com/KhronosGroup/glslang/commit/6274ec5c

After this change, renderdoc passes the environment through to the
pre-processor, and with the current parameters to setEnvInput(),
glslang will start to define GL_SPIRV in the shaders during
pre-processing.

Then, in renderdoc's glsl_globals.h, GL_SPIRV causes the pre-processor
to set:

 * #define IO_LOCATION(l) layout(location = l)

which then causes Mesa to produce this error when compiling the shader:

 * GL_VERTEX_SHADER compile error: 0:239(2): error: shader output
   explicit location requires GL_ARB_separate_shader_objects extension
   or GLSL 4.20

Signed-off-by: Jordan Justen <jljusten@gmail.com>
2022-01-27 11:59:25 +00:00
baldurk 3e8ecc6040 Fix unit test expectations for specialisation constants 2021-11-16 17:09:37 +00:00
baldurk 39d31e880d Handle vertex picking in world space for post-projection data
* Previously the vertex picking was always being done in NDC space, but now for
  perspective projections we unproject into world space and raycast there for
  more reliable results with unsual projections.
2021-10-28 11:24:46 +01:00
baldurk 90f3417039 Don't generate potentially unsupported vertex formats to ignore W
* When using VS In we want to ignore the W component, but that already happens
  explicitly for vulkan/GL in the shader. Mirror that same solution to D3D
  instead of trying to force a 3-component format which may not be supported
  (e.g. on AMD R16G16B16_*)
2021-09-13 19:11:28 +01:00
baldurk 1ed4b561e6 Fix discard patterns to work correctly with multisampled UINT textures 2021-05-27 14:18:05 +01:00
baldurk 3ed516a7f6 Fix unit tests 2021-04-14 19:40:20 +01:00
baldurk c470a0abf6 Remove old workaround for glslang bug 2021-02-18 15:41:54 +00:00
baldurk 20d8ae2dcf Fix display of 3D texture slices when linear sampling
* When displaying mip 0 of a texture at less than 100% zoom we linear sampling,
  but we don't want to linear sample across slices. Adding a half pixel offset
  in z ensures we sample precisely on the slice itself.
2021-01-20 17:15:34 +00:00
baldurk 0c410d40ef Fix issue showing whole pass in mesh viewer with inverse view height
* In particular this was breaking if not all draws in the pass used an inverse
  view (unlikely in practice, but comes up in our tests).
2021-01-19 17:20:15 +00:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk 580f96c8a1 Rename ShaderVariableType/Descriptor to ShaderConstant
* These structs are no longer used with ShaderVariable so the name is misleading
  at best.
2020-12-09 15:18:27 +00:00
baldurk 2bfa2c0ced Move histogram/minmax shaders into vulkan shader cache
* This lets us cache all shaders instead of having some be regenerated outside
  the cache and looked up into it.
2020-09-04 16:39:42 +01:00
baldurk 9858f516d0 Set default precision specifiers earlier in GLES shader 2020-08-07 12:46:17 +01:00
baldurk 02a54be6ad When replaying resource discards fill with explicit pattern. Closes #284
* This helps catches cases where a discarded image is accidentally used and in
  many cases may still have valid data. Particularly on Vulkan this is relevant
  for DONT_CARE renderpass load and store ops.
2020-07-13 17:29:11 +01:00
baldurk f0fe801d27 Specify RC include paths instead of using a macro for the output path
* This fixes an issue with builds failing when the path contains some characters
  RC doesn't like for some reason, even if it's quoted.
2020-07-12 10:51:51 +01:00
baldurk 0bd48d3c2c Update overlays to use DXIL as needed
* This is needed because D3D12 requires all shaders in a pipeline to use DXIL if
  any do.
* We try to bake the couple of DXIL shaders that we will mix-and-match with
  application shaders at build time, in case we aren't able to find a working
  dxcompiler at runtime to build them. But this can only happen if we find a
  working dxc.exe in one of the windows 10 SDKs.
2020-06-18 17:22:44 +01:00
baldurk 9f210d5617 Hardcode variants of fixed colour shader needed on D3D12
* We will be adding an offline baked version of the DXIL variant of each of
  these, so we want to make it friendly to build-time generation.
2020-06-18 17:22:44 +01:00
Aliya PazylbekovaandBaldur Karlsson 0fd3d65a6f Vk Pixel History: support other depth formats MSAA
- Separate the pixel history copy pixel shader into two separate
  shaders, one for colour copy and one for depth
- Allocate and update descriptor sets on demand
- Add another compute shader for pixel history depth copy
2020-05-26 21:19:55 +01:00
baldurk e31ebd0f55 Work around presumed QC driver bug storing to array slices 2020-05-14 20:33:20 +01:00
baldurk 90c10ea1fc Handle boolean inputs in vulkan shader parameters
* We change to use VarType instead of CompType for signature parameters which
  allows us to represent different types of variables beyond just
  unsigned/signed integer and float.
2020-05-07 22:46:41 +01:00
Aliya PazylbekovaandBaldur Karlsson 41b911d1d0 Vk Pixel History: MSAA depth/stencil copy, shader out
Use a separate compute shader module for MSAA copy, and output
directly into the destination buffer instead of creating
staging resources.

Support case where there is no depth stencil attachment to get post mod
values in per fragment reporting. Previously used the original
framebuffer that might not have had depth/stencil view, so couldn't
count the fragments. Now use the sub image.

To get the post mod color, we need to blend with the premod color, so
we use vkCmdCopyImage to copy from the original image.
2020-05-06 19:35:25 +01:00
Aliya PazylbekovaandBaldur Karlsson 2cb546686b Vk Pixel History: multi sampled colour
Colour only, depth/stencil copy not supported.
This means that we only report pre-mod and post-mod colour values for
events. Since stencil copy is not supported, number of fragments is
not reported, and shader output is not queried.
2020-04-29 18:48:37 +01:00
baldurk 745b65b3d2 Fix sampling from cube textures 2020-04-27 17:03:12 +01:00
baldurk 105f0e4e9f Fix GL handling of matrix parameters to specify :col instead of :row
* In GL matrices are also split column-wise
2020-04-24 20:51:32 +01:00
baldurk 18713f644e Implement OpImageQueryLod by faking derivatives on sample quad 2020-04-23 19:14:09 +01:00
baldurk 7d0d492a66 Add missing copyright statement in shader 2020-04-10 16:58:52 +01:00
Aliya PazylbekovaandBaldur Karlsson 8d2ad78f05 Vk Pixel History: refactoring, per fragment depth
- Refactor to use common funcs
- Add per fragment depth data
- Rename pixelhistory.frag to pixelhistory_primid.frag
- Fix how some per fragment pipelines are created

For per fragment data we create 3 pipelines
1) Post modification pipeline
changes the stencil state and scissors around the target pixel
2) Shader output pipeline
in addition to above, disables rasterization discard, depth bounds test,
culling and turns off blending
3) Primitive ID pipe
in addition to above, disables depth test and depth write, and changes
the fragment shader to only output primitive ID
2020-03-20 16:16:12 +00:00
Aliya PazylbekovaandBaldur Karlsson 83623af8d8 Vk Pixel History: per fragment data
- For now only per fragment primitive ID, and colour values, not depth
information.
2020-03-20 16:16:12 +00:00
baldurk cb94a28768 Create GLES shaders as version 300 if replaying on GL ES 3.0. Refs #1770 2020-03-11 18:00:53 +00:00
baldurk 936e6372cb Remove use of 3rdparty/ prefix from includes
* We instead always have 3rdparty/ in the relevant include search paths and rely
  on that. Each library still has its own unique base dir within 3rdparty to
  clarify where the include is coming from.
2020-03-11 18:00:53 +00:00
baldurk 295d3958dd Refactor D3D11 pixel history to use buffer output instead of texture
* This removes the requirement that the colour output format be UAV-compatible.
* It also makes addressing simpler and removes the requirement for
2020-02-18 19:18:51 +00:00
baldurk a98a8c49a7 Improve handling of multi-dimensional array input/outputs from shaders 2020-02-03 18:18:16 +00:00
baldurk df266eb04d Fix some version properties in windows resource files 2020-01-14 18:02:10 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk e9bb5a8219 Initialise color when doing manual resolve on GL 2019-12-18 19:09:18 +00:00
baldurk 14d01ff995 Remove support for serialising STL types, remove STL interop 2019-12-16 18:10:32 +00:00
baldurk bd9f4fc389 Remove use of vector/string from core project
* This also affects the drivers via interfaces e.g. IReplayDriver and some
  utility functions.
2019-12-16 18:10:31 +00:00
baldurk f68645bddc Reduce dependencies pulled in by common.h 2019-12-16 17:06:16 +00:00