Commit Graph

16410 Commits

Author SHA1 Message Date
baldurk dceced1496 Add a clean FBO to copy from for target image
* The target image won't always be bound to the (or any) current framebuffer, if
  e.g. it's written via image storage. Ensuring we still have a framebuffer to
  copy from keeps most code the same.
2025-10-27 11:50:18 +00:00
baldurk 15fb73a83d Disable depth bounds test as needed when we want depth testing off 2025-10-27 11:50:18 +00:00
baldurk 802a8aa845 Note whether GL pixel history target is depth or colour 2025-10-27 11:50:17 +00:00
baldurk 0be1edd78b Add separate pre/post mod reading in GL pixel history
* We will want to be able to batch these independently and this approach is
  easier with fixed slots than having a slot per type in the same framebuffer.
2025-10-27 11:50:17 +00:00
baldurk 426f9724c0 Mark unbound pixel shader in GL pixel history 2025-10-27 11:50:17 +00:00
baldurk a4ad0f0d2b Ensure GL pixel history finds all possible modifying events
* All tests must be disabled as much as possible, including depth clipping and
  depth bounds, as well as binding a fixed shader for potential shader discards.
2025-10-27 11:50:17 +00:00
baldurk 724bce2d20 Don't ignore based on bound framebuffer for clear or direct writes 2025-10-27 11:50:17 +00:00
baldurk d768527918 Check for discarding at a per-pixel level for test failures on GL 2025-10-27 11:50:17 +00:00
baldurk d2a524ee5b Check for depth clipping and depth bounds failures on GL pixel history 2025-10-27 11:50:17 +00:00
baldurk 1c970a7868 Add global helper for naming D3D12 objects with normal strings 2025-10-27 11:50:17 +00:00
baldurk 384b952625 Use uint/sint type for per-fragment postmod and shaderOut
* We also use a UAV clear for integer targets as needed
2025-10-27 11:50:17 +00:00
baldurk 0cbaefe557 Match target subresource in use for D3D12 pixel history work 2025-10-27 11:50:17 +00:00
baldurk 6f98e46da2 Add helper for quantised-checking of depth test failures on fragments 2025-10-27 11:50:16 +00:00
baldurk 50976369db Depth clears are considered to have depth in D3D12 pixel history 2025-10-27 11:50:16 +00:00
baldurk cc05571135 For vulkan pixel history on MSAA images, always rebind compute state
* The copying of a pixel happens via compute for MSAA targets so the compute
  state becomes dirty in CopyPixelForPixelHistory - we rebind all state to
  ensure it is properly re-set. This is not needed if non-MSAA.
2025-10-27 11:50:16 +00:00
baldurk 7ef6d5d3e0 If there's no depth attachment, disable depth testing during history
* When we add a depth attachment we want to ensure this doesn't "activate" a
  dormant depth test/bounds state which was inactive before due to the lack of
  an attachment, so turn them off explicitly in our replacement pipelines.
2025-10-27 11:48:07 +00:00
baldurk cf42a3ea5c The depth bounds test doesn't run if there is no depth target bound 2025-10-27 11:45:36 +00:00
baldurk f626625490 Query correct attachment for mip/slice in GL clears 2025-10-27 11:45:35 +00:00
baldurk 1521278fd5 Only avoid duplicate failures when exceptions are raised 2025-10-27 11:45:35 +00:00
baldurk 929548f478 Add dummy reads to pipes for linux for some reason 2025-10-27 11:45:35 +00:00
baldurk 969c299448 Silence silly validation warning 2025-10-27 11:45:35 +00:00
Jake Turner fccf3c0408 DXIL Shader Debugger fixes for GPU batching of SampleGather operations 2025-10-27 10:11:17 +00:00
Jake Turner 80307c944c Fetch workgroup inputs for DXIL shader debugger
Used when debugging a subgroup with workgroup operations get the entire workgroup.
Get the subgroup (and workgroup) layout of threads from the GPU instead of assuming tightly wrapped.
Ensure the lane input data is organised to match the simulation expectations
2025-10-25 16:09:19 +01:00
Jake Turner a704828303 DXIL Debugger Load operations copy from backing memory
Don't use the cached value, fixes problems with GSM on a POD type (not array)
Atomic operations always load GSM from global backing memory
2025-10-25 15:57:00 +01:00
Jake Turner f9788d1289 DXIL Debugger ignore duplicate change if baseMemoryId == ptrId 2025-10-25 15:26:03 +01:00
Jake Turner 17e97ca1b0 DXIL Debugger support for runtime Bitcast on a pointer source 2025-10-25 15:25:27 +01:00
Jake Turner 5b47b73f4d Change DXIL UAV out of bounds or null write to be a warning not error 2025-10-25 15:25:13 +01:00
Jake Turner cb83fac970 DXIL debugger support for GPU batching of Math and SampleGather ops 2025-10-25 15:12:39 +01:00
Jake Turner 6bb8070fd2 Add a lock around Atomic memory operations in DXIL debugger 2025-10-25 15:00:07 +01:00
Jake Turner 02f08bb051 DXOp::WaveIsFirstLane considers helper lanes as active 2025-10-25 14:46:38 +01:00
Jake Turner 7b146ec97d Convert DXIL Debugger to run simulation multi-threaded
Enabled by default : config option "D3D12_DXIL_Debug_EnableShaderDebugMT"

By default run jobs in a hot spin loop in a single JobQueue job
Each JobQueue Job runs SimulationJobHelper which is a while loop looking for threads to simulate

Developer option "D3D12_Hack_ShaderDebugUsesJobSystemJobs" to run simulation steps in individual job system jobs.
2025-10-25 14:33:12 +01:00
Jake Turner 0e20fbf9fb Added caching to DXIL APIWrapper and Debugger
Added TypedUAV Load/Store to APIWrapper
2025-10-25 14:17:40 +01:00
Jake Turner f72c1a3769 DXIL debugger support for queued GPU operations (run on Device Thread) 2025-10-25 14:04:19 +01:00
Jake Turner 516dec8e17 DXIL debugger support for queue and run simulation on Device Thread 2025-10-25 13:49:28 +01:00
Jake Turner 0243927d43 DXIL Debugger can simulate multiple instructions per step 2025-10-25 13:36:33 +01:00
Jake Turner fe8e63f7ec Reworked DXIL debugger simulation in preparation for multithreading
Rearranged to isolate the simulation of a single lane into a helper function: InternalStepThread(uint32_t lane)
2025-10-25 13:24:43 +01:00
Jake Turner c4fa11b6e6 Assert for DXIL the subgroup is converged for subgroup ops 2025-10-25 13:12:20 +01:00
Jake Turner 34a8af762b Cache DXIL SSA ID Result names
The disassembly will populate the cache and the debugger will reuse the cache
2025-10-25 13:00:24 +01:00
Jake Turner 99b3137b41 Add asserts for DXIL ThreadState APIs to be called on the device thread 2025-10-25 12:47:25 +01:00
Jake Turner 6ce3e5a6ec Add asserts for DXIL Debugger APIs to be called on the device thread 2025-10-25 12:35:46 +01:00
Jake Turner 755c96640f Add asserts for D3D12APIWrapper APIs to be called on the device thread 2025-10-25 12:23:54 +01:00
Jake Turner c74022dfd2 Remove use of APIWrapper from DXIL ThreadState
Make the APIWrapper calls become Debugger APIs which then call the wrapper
2025-10-25 12:08:18 +01:00
Jake Turner 97283a60e2 Change DXIL Shader Debugger steps chunk size to 1,000,000
Helps to reduce the number of replays during shader debugging which helps when captures have non-deterministic replay
2025-10-25 11:53:42 +01:00
Jake Turner d7169cf8b0 Rework DXIL ThreadState in preparation for Multithreading
Make all members private with Set/Get APIs are required.
Mark containers which must be thread safe
2025-10-25 11:53:42 +01:00
Jake Turner 0dba797e30 Rework DXIL D3D12APIWrapper helper in preparation for Multithreading
Make it persistent in the lifetime of the DXIL Debugger session
Add the wrapper to the DXIL Debugger
Make the wrapper replay reset consistent
Store initialisation data in the ApiWrapper
Pull data from ApiWrapper into Debugger during BeginDebug()
Makes DXIL debugger behave more like SPIRV debugger during its initialisation
2025-10-25 11:53:42 +01:00
Jake Turner 1ea88a43f2 Remove D3D_Hack_EnableGroups
Now supported by default for D3D11 & D3D12
2025-10-25 11:53:42 +01:00
Jake Turner a4d407ec3a Enable D3D11, D3D12 groupshared, subgroup, workgroup tests
D3D11_Groupshared, D3D12_Groupshared
D3D12_Subgroup_Zoo
D3D11_Workgroup_Zoo D3D12_Workgroup_Zoo
2025-10-25 11:01:13 +01:00
Jake Turner bc403a291d DXIL debugger handle all int/float types for DXOp::Dot2/3/4 2025-10-25 10:17:24 +01:00
Jake Turner 8a725233d6 DXIL debugger handle all float types for DXOp::Saturate 2025-10-25 10:16:56 +01:00
Jake Turner eebb66eea1 DXIL debugger handle all int types for DXOp::IMin, IMax, UMin, UMax 2025-10-25 10:16:19 +01:00