Commit Graph

16421 Commits

Author SHA1 Message Date
baldurk 2bdcc3dd2f Ensure pixel history is consistent about unknown depth or colour data 2025-10-27 11:50:35 +00:00
baldurk 9c001c3f59 Fix D3D12 pixel history not properly picking up discarded fragments 2025-10-27 11:50:35 +00:00
baldurk f459440d03 Fix issues with mismatching float/uint bindings in D3D11 pixel history 2025-10-27 11:50:35 +00:00
baldurk eb3136808d Fix handling of 3D attachments in pixel history 2025-10-27 11:50:35 +00:00
baldurk f12b2573ad Fix calculation of subresource for mip/slice D3D11 pixel history 2025-10-27 11:50:18 +00:00
baldurk bc1caaffee Ensure all UAVs are unbound for D3D11 pixel history pixel copy
* This is necessary so the source texture can be bound as an SRV - we already
  unbind all RTVs.
2025-10-27 11:50:18 +00:00
baldurk 30a2b704e2 Correctly handle some fragments discarding when doing stencil counting
* If some fragments discard then our stencil counting goes off-by-one. Use
  primitive IDs to render primitives in isolation and determine which ones
  discarded so we can adjust stencil counting as needed.
2025-10-27 11:50:18 +00:00
baldurk 74ecbd235a Explicitly fetch pre/postmod values per-fragment with stencil counting
* This is more precise than propagating pre/post mod
2025-10-27 11:50:18 +00:00
baldurk 4d96b492ec Determine which events had some fragments discard in GL pixel history 2025-10-27 11:50:18 +00:00
baldurk c17557eb5f Always use full precision format for shader output in GL pixel history 2025-10-27 11:50:18 +00:00
baldurk e17a10e329 Fetch clean values for per-pixel pre/post mod in GL pixel history
* We can't assume that premod == postmod in all cases. For colour history on a
  colour target it will be, but depth values can change indepednently. Instead
  we explicitly fetch pre/post mod before and after each event instead of just
  postmod.
2025-10-27 11:50:18 +00:00
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