* 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.
* 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.
* 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.
- 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
* 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.
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.
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.
- 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
* 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.
* 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.
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
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.
* 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.