Commit Graph
320 Commits
Author SHA1 Message Date
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
baldurk 02933fb6a6 Update glslang to 12.3.1 2023-08-22 13:37:53 +01:00
baldurk f621e5e083 Fix reversed uint/int bindings in glsl custom shader templates 2023-05-16 17:53:16 +01:00
baldurk 38afb7c8ad Fix handling of S8 multisampled textures. Closes #2883 2023-03-14 16:32:06 +00:00
Orson BainesandBaldur Karlsson d7042643ce Address Pixel History PR feedback
- change mscopy compute shader to use same as vulkan
- default to sample 0 when average value is selected
2023-02-14 10:07:07 +00:00
Orson BainesandBaldur Karlsson d87f505a26 OpenGL Pixel History Multisampling support
- Read pixel value from the selected sample
- Support the average value for multisampled textures
- Mark events that fail sample mask
2023-02-14 10:07:07 +00:00
baldurk d47e79ae07 Update copyright years to 2023 2023-02-01 12:23:32 +00:00
baldurk 220b26aa59 Handle collisions with existing UAVs in root signature when patching
* When debugging a pixel or doing quad overdraw we replace the pixel shader and
  patch in our own UAV. Previously we were moving other UAVs out of the way that
  were visible to the pixel shader, but this fails if a UAV is visible to all
  stages and used in a vertex stage.
* Now instead for pixel shader inputs we pick a free space and use it. For quad
  overdraw we pick an arbitrary high space to hopefully use the precompiled
  shader, and if it's somehow not free we recompile the shader with a free
  space.
2023-01-06 16:53:20 +00:00
Orson BainesandBaldur Karlsson 5b5d2aa191 Improve GL Pixel History per PR feedback
- Blit fragments and read back results in batch
- Modify per fragment callbacks to reduce number of full replays
- Use defines in the primitiveId shader to toggle between float/int
  output
2023-01-05 14:37:55 +00:00
Bruce HeandBaldur Karlsson c0b931eb15 Improved fragment id shader code
- Deleted WriteClearValues and replace with QueryPostModValues
- Add support for earlier GLSL versions and fix logic for creating primitive id program
- Changed to only run per fragment queries on events with multiple fragments
2023-01-05 14:37:55 +00:00
baldurk 0acb955e19 Create virtual distinction between Vulkan & GL SPIR-V. Closes #2798
* This distinction unfortunately does not exist in SPIR-V so we have to carry
  around this metadata ourselves. Rather than allowing free specification of
  tools based on API, instead pretend that Vulkan and GL SPIR-V are separate
  format, and duplicate all SPIR-V tools to handle "both" types. This allows
  appropriate tool selection based on the encoding.
2022-12-27 13:39:44 +00:00
baldurk 6f29b8b939 Work around fxc warnings when building with optimisation disabled 2022-10-27 16:22:54 +01:00
baldurk 9e9a333b56 Fix D3D shader debug ddx/ddy being the wrong way around 2022-10-27 16:04:35 +01:00
baldurk ea4aa16455 Force custom display shaders VS explicit output location. Closes #2757
* This works around an obtuse GL requirement that explicit locations on one side
  will cause a break in compatibility with the other side, even if dropping the
  location would work otherwise.
2022-10-20 12:50:00 +01:00
baldurk 234262649f Fix calculation of small mip co-ordinates for NPOT textures 2022-07-15 18:07:08 +01:00
baldurk 9603f5a925 Pre-compile shaders for math and sampling opcodes during shader debug
* D3D12 math shader was already precompiled, but on D3D11 we now allocate
  everything up front and on D3D12 we also up-front compile sampling.
* The only exception is const offsets which can't be variable, so we cache these
  (likely we'll only see a few variants per shader/capture) and create them on
  demand.
2022-06-30 13:51:27 +01:00
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