Commit Graph
253 Commits
Author SHA1 Message Date
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 Pazylbekova 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 Pazylbekova 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 Pazylbekova 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 Pazylbekova 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 Pazylbekova 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
baldurk 5f72b9d53c Remove std::string/std::vector use from os-specific layer 2019-12-16 17:06:15 +00:00
baldurk ff08748238 Ensure all files have trailing new-lines and enforce with clang warning 2019-12-02 20:28:05 +00:00
baldurk 11c39377b1 Handle range adaption in texture remapping
* This can be used in saving overlays, stencil, etc
2019-11-27 11:05:24 +00:00
baldurk 938056a67c Add support for serialising MSAA initial states on GL 2019-11-26 17:38:27 +00:00
baldurk edc8fb6bd6 Be more precise with texture remapping to handle integer textures 2019-11-26 17:38:26 +00:00
baldurk c497446524 Simplify D3D texture render shader parameters, fix scaling bug in D3D12
* We previously relied on setting the viewport smaller than the output
  dimensions in D3D11 to scale for lower mips. In D3D12 the viewport is set to
  the output dimensions internally so we can't do that, so instead apply a
  manual scale.
2019-11-13 10:05:30 +00:00
Gert Wollny 44e7bbe439 gl: Handle the use of (u)intBitsToFloat by using a separate define
The shader code is preprocessed with glslang that doesn't use the driver
capabilities to define macros indicating the availability of extensions,
instead it uses its own set of supported extensions, and in this case
it supports ARB_gpu_shader5. As a result the generated shader code would
make use of the (u)intBitsToFloat conversion functions based on the define
GL_ARB_gpu_shader5 also if the driver doesn't support this extension.

Hence an additional define is added to indicate whether bit casting
functions are available, and the extension is only enabled/required when
the driver actually supports it.

Closes: #1586

v2: - Fix ws
    - reword commit message

v3: - check for ARB_shader_bit_encoding and ARB_gpu_shader5 in shader creation code
    - don't enable GL_ARB_gpu_shader5 unconditionally in the OpenGL shader
    - reword commit message

v4: Use an additional define HAS_BIT_CONVERSION to make sure gslang correctly
    parses the shader code (Baldurk).

v6: - Add HAS_BIT_CONVERSION also with the GLES code path (Baldur)
    - split patch
    - reword commit message(s) (Baldur)

v7: fix ws

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>

lala
2019-11-11 14:50:46 +00:00
tabi.katalin 4037927834 Fix histogram shader compilation for GLES
These are not supported in GLES and causes shader compile errors when replaying a capture: 
- OpenGL does not allow swizzles on scalar expressions
- implicit cast from "int" to "float"
- implicit cast from "int" to "uint"
Scalar swizzling can be replaced by vec4 and constant types can be explicitly specified.
2019-10-24 18:02:10 +01:00
baldurk 8ce2ea2202 Improve calculation of histogram
* The histogram shouldn't be calculated as channel-wise averages, but instead by
  'stacking' the channels (each channel contributes 1 to the appropriate
  bucket).
* Degenerate channels (where min==max) are excluded and listed only as a single
  spike, to avoid blowing out the automatic y-axis.
2019-10-10 16:48:42 +01:00
baldurk 2d473c39e7 Keep format in GL shaders for R/W images 2019-09-23 13:45:29 +01:00
Dominic Filion Guay 57c60cdfb8 Fixed issue with MSAA textures on Oculus Quest. 2019-09-18 19:28:42 +01:00
baldurk 6971a585aa Fix compilation on 32-bit windows 2019-08-26 16:52:09 +01:00
baldurk 3b524ea7f1 Fix reflection of arrays-of-binds - textures and buffers 2019-08-26 13:22:26 +01:00
baldurk 07158ad24c Fix support for triangle fans on GL/Vulkan 2019-08-20 15:33:12 +01:00
baldurk 9e68cbe59b Fix typo in unit tests 2019-08-16 19:00:40 +01:00
baldurk 0c3b827b35 Test specialization constant IDs and default values properly 2019-08-16 17:38:35 +01:00
baldurk dc660aa26c Allow building SPIR-V with debug info and check debug info in reflection 2019-08-16 17:38:35 +01:00
baldurk 3b00566ace Move GLSL reflection tests to common place for SPIR-V to use 2019-08-16 16:12:01 +01:00