Commit Graph
336 Commits
Author SHA1 Message Date
baldurk 8e86f79c72 Fix compiling pixel history shaders on GLES breaking 2025-04-29 12:09:38 +01:00
Le PhilousopheandBaldur Karlsson bf1ebeeb86 Allow custom visualisation shaders to be used with GLES
With GLES, a precision specifier is mandatory for float types.
Specifying one in the user shader is not enough because it happens too
late after uvec2 and uvec4 uses in the custom prefix.
2025-04-24 12:02:24 +01:00
baldurk 58cace21fb Add hlsl helper for reading other lanes via derivative swizzling 2025-03-14 18:54:38 +00:00
baldurk 2322e165de Update copyright years to 2025 2025-03-14 18:54:37 +00:00
baldurk faa13cb568 Only use one colour output for discard PS on vulkan
* Fixes a minor validation warning (which may or may not be legit, but is easy
  to silence)
2025-02-05 16:36:55 +00:00
baldurk b8def8854e Fix typo accidentally introduced 2025-01-21 10:27:20 +00:00
baldurk a3a5f07a7e Workaround compile error on old fxc's using .sample on 2DMS texture 2025-01-17 15:41:54 +00:00
baldurk 70c6dd32a2 Implement auditing of indirect RT dispatches 2024-12-05 13:31:35 +00:00
Jake Turner 3129d1dd88 Shader Debug HLSL shader remove the SM6.8 branch 2024-10-27 11:17:48 +00:00
Jake Turner f538e91b05 DXIL Debugger extended support for GPU Sampling instructions
DXOp::Sample
DXOp::SampleBias
DXOp::SampleLevel
DXOp::SampleGrad
DXOp::SampleCmp
DXOp::SampleCmpBias
DXOp::SampleCmpLevel
DXOp::SampleCmpGrad
DXOp::SampleCmpLevelZero
DXOp::TextureGather
DXOp::TextureGatherCmp
2024-10-24 12:54:10 +01:00
Jake Turner a5b63f2f26 Shader Debug HLSL split debugSampleLodCompare into two variables 2024-10-24 12:44:07 +01:00
baldurk b4c659eb9a Handle unrolling array-of-pointers for replay-time AS builds 2024-10-19 01:21:47 +01:00
baldurk 60d2e30f43 Do indirect copy via EI to fetch array of instances layout 2024-10-19 01:21:47 +01:00
baldurk 3c6520d250 Add support for multiview with quad overdraw overlay. Closes #3424
* We multiply the internal array image up by the number of views and read from
  viewindex to write and resolve from different sets of slices
2024-09-09 14:43:17 +01:00
Jake Turner dbd4d7cf0d Fix DXIL Shader Debugger GPU implementation of EXP & LOG
DXIL EXP is exp2. HLSL is exp.
DXIL LOG is log2. HLSL is ln.
2024-07-02 14:20:14 +01:00
Jake Turner 64b966f4df D3D12 ShaderDebugging adding helper namespace D3D12ShaderDebug
Added

bool D3D12ShaderDebug::CalculateMathIntrinsic(WrappedID3D12Device* device, MathOp mathOp, const ShaderVariable &input, ShaderVariable &output1, ShaderVariable &output2);

which is used by DXBC and DXIL ShaderDebugger CalculateMathIntrinsic methods

Extended shaderdebug.hlsl math intrinsics to support DXIL math opcodes

Use custom math operation values for DXBC and DXIL, not the DXBC OpCode value.
Use custom sampler operation values for DXBC and DXIL, not the DXBC OpCode value.

This changes DXBCDebug::DebugAPIWrapper, updated D3D11DebugAPIWrapper to match changes to interface and shader math and sample operation values.
2024-06-27 09:27:13 +01:00
baldurk a90d3eb9c8 Account for padding in argument constant buffer for EI patching 2024-06-25 17:25:15 +01:00
Jake Turner 734eac9657 Fix compiler warnings in shaderdebug.hlsl
truncation warnings about passing float4, int4 to float1/2/3, int1/2/3
2024-06-20 14:47:56 +01:00
Jake Turner 0d1b8f8154 Embed D3D12 Pixel History DXIL compiled shaders as resources
Fallback to use the embedded compiled shader if the source shader fails to compile
Only try to get pixel history DXIL shaders for captures that use DXIL
2024-06-20 14:25:08 +01:00
baldurk c7c9d79ceb Add indirect patching of shader records for indirect ray dispatch
* We use a worst-case estimate of how much scratch buffer space will be needed
  as there's no way to know beforehand on the CPU.
2024-06-13 13:33:06 +01:00
baldurk e03c17d079 Refactor ray dispatch patching
* This makes the shader more amenable to running indirectly for indirect
  patching
2024-06-13 13:33:06 +01:00
baldurk 7e8aa58ea1 Fix alignment issues with heap lookup data 2024-05-27 10:13:57 +01:00
baldurk 4ba41dae23 Add [allow_uav_condition] tag to compile on older versions of fxc 2024-05-17 11:39:51 +01:00
baldurk 96da861a40 Patch root GPUVA parameters during replay 2024-05-13 16:35:55 +01:00
baldurk 9b3861a97f Fix loop looking up shader record offset 2024-05-09 15:00:30 +01:00
baldurk 84dc120871 Fix GPU patching of handles in local root signatures 2024-05-09 15:00:30 +01:00
baldurk b06e7030a5 Implement GPU unwrapping of handles in shader records 2024-04-30 18:28:33 +01:00
baldurk a9849c050b Implement shader identifier patching during capture 2024-04-30 18:28:33 +01:00
baldurk cfc5204a69 Don't require dxc for compiling RT patching shaders
* We do some manual uint64 emulation with uint2 which compiles on fxc, re-used
  from the execute indirect patching.
2024-04-30 18:28:33 +01:00
baldurk 2f9f3cd6a0 Fix GL reflection unit tests
* GL no longer reflects out fixed bindings and relies purely on queried
  uniforms.
2024-04-10 21:28:48 +01:00
baldurk ca144ab818 Remove magic specialisation constant and push constant set numbers 2024-04-10 18:58:53 +01:00
baldurk 6194d5a5a0 Rename resType to textureType in ShaderResource to be more accurate 2024-04-10 18:58:52 +01:00
baldurk 205ed0e6fa Remove old shader bindpoint mapping handling entirely 2024-04-10 18:58:52 +01:00
baldurk 227842a295 Add a structure and query for reporting descriptor accesses 2024-04-10 15:33:36 +01:00
Amit Prakashandbaldurk 6254393bdf Add serialisation & replay of Acceleration structure build calls
* Add patching of BLAS address in TLAS
* Add a compute shader to patch the BLAS address
* Adds a pipeline, and root signature for patching the BLAS
2024-03-01 12:11:37 +00:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
Jovan RisticandJake Turner b197091212 Fix D3D12 pixel history MRT issues.
* Previously MRT draws were reduced to a single RT with the pixel
history color target bound, which meant shader output was always
showing the results for RT0 rather than the target requested.
* Shader-out and post-mod passes of the per fragment callback have been
changed to keep all RTs bound and replace the history target into the
correct slot. The RenderTargetWriteMask is used to mask out all writes
to everything but the history target.
* The pixel history fixed color write shader has been changed to
provide 8 variations, each of which writes to only one of the possible
RTs. This prevents the other targets from being polluted by unintended
writes and fixes the validation warnings about shaders writing to RTs
that will not be bound.
* Unused render target index was removed from the occlusion callback.
2024-01-16 09:03:38 +00:00
Jovan RisticandJake Turner 7e8c22ce68 Fix D3D12 pixel history MSAA test issues.
* Add missing resource transitions for the dispatch copy to fix
validation issues encountered while running the test.
* Adjust the MSAA copy path to use the second channel for stencil to
fix copies failing to output anything, which manifested as the fragment
only showing one primitive without correct output data.
2024-01-02 12:15:37 +00:00
Dan HawsonandBaldur Karlsson 442b48bb77 Mesh exploder
New 'Exploded' visualisation mode in BufferViewer with new exploder controls
hidden when not in 'Exploded' mode.

Change 'solidShading' and 'solidShadeMode' to 'visualisation' and
'visualisationMode'.

Hide the 'highlightVerts' widget when using 'Exploded' vis for both
real-estate and practical implementation reasons.
2023-12-09 11:40:30 +00:00
Jake Turner defe79d82c D3D11 Depth Overlay improvements
Handle depth copying with a texture array source
Clear stencil to zero during the depth copy to match the other implementations
Specify the bind flags when creating the new depth-stencil texture
2023-12-03 21:00:34 +00:00
baldurk 70b2fac658 Fix compile warning on some D3D12 HLSL compiler versions 2023-11-17 00:47:55 +00:00
baldurk 1df7c1ae81 Implement mesh viewer support for task/mesh shaders 2023-11-17 00:47:55 +00:00
Jake Turner 74b0a8b1a7 Small tweaks to GL and HLSL shaders used to copy depth for Depth overlay 2023-11-09 15:10:54 +00:00
Jake Turner e1e179bd53 Extend D3D11 Depth Test Overlay
Support shader exported depth by replaying using the capture pixel shader to determine passing pixels

Don't write depth or stencil during the reply of failing pixels
No need to restore depth-stencil after replay of failing pixels
2023-11-09 12:05:57 +00:00
Jake Turner de06321536 Extend GL Depth Test Overlay
Support shader exported depth by replaying using the capture pixel shader to determine passing pixels via a stencil mask
2023-11-06 14:38:04 +00:00
baldurk de6f4346b7 Fix UInt/SInt bindings being swapped on D3D custom visualisation shaders 2023-10-25 17:56:38 +01:00
Steve KarolewicsandBaldur Karlsson b3bc0e98bc D3D12 pixel history copy pixel and resource creation
This adds some of the D3D12 pixel history framework, with creation
of resources that will be needed during pixel history, and a helper
function and shader to copy pixels from MSAA resources.
2023-10-10 11:33:34 +01:00
baldurk 55dae7ebc6 Refactor D3D12 ExecuteIndirect handling to patch arguments on GPU 2023-09-18 11:21:50 +01:00
baldurk 9d39b8e1a8 Reformat code for clang-format 15 2023-09-05 11:02:08 +01:00
baldurk 69fc6f8abe Fix unit test for new built-in compile flag 2023-08-22 16:03:27 +01:00