Commit Graph

15345 Commits

Author SHA1 Message Date
Jake Turner 23c7e1cfea D3D12 Shader Debug Zoo : add a test for Texture2D Store 2024-12-09 14:35:49 +00:00
Jake Turner 0fcecf0a15 D3D12_Shader_Debug_Zoo only do 16bit tests if runtime supports it
Check using Native16BitShaderOpsSupported
2024-12-09 12:50:43 +00:00
baldurk acc29c9291 Use unwrapped memory map/unmap functions for GPUBuffer
* If we use the wrapped functions this can deadlock on the CapTransitionLock
  when using GPUBuffers during capture.
2024-12-06 16:25:08 +00:00
baldurk bc5bd00205 Cap oversized soft-memory allocations at 512MB
* This allows a larger soft-memory limit without allocating too much memory in
  one block, but still allows low soft-memory limits to cap the size of memory
  blocks.
2024-12-06 16:25:08 +00:00
baldurk 9703cf23e3 Don't use BeginQuery/EndQuery to initialise AS queries 2024-12-06 15:59:22 +00:00
baldurk 1e977fe889 Use configurable overestimate to account for incorrect maxVertex
* We do this already on D3D12, this applies the same change to Vulkan -
  maxVertex can't really be trusted but we hope it is approximately right or the
  VBs are small, we don't want to copy the whole VB since it may be massive.
2024-12-06 15:59:22 +00:00
baldurk ab6381319f Skip options5 entirely
* No longer modifying this one.
2024-12-06 13:38:49 +00:00
baldurk 8de3242825 Enable all features in options5 2024-12-06 13:38:48 +00:00
Jake Turner c85835ce4b Enable DXIL Debugging
Remove config option D3D12_Experimental_EnableDXILShaderDebugging
2024-12-06 11:13:29 +00:00
Jake Turner f7cc72c9da DXIL Debugger change SSA lifetime to use block and instruction index
Use control flow to determine the ordering of ExectionPoint's (block + instruction index)
Can't use pure instruction index because programs do not have to have linear flow and monotonically increasing instruction index
Can assign to an SSA ID at an instruction index larger than when the SSA ID is accessed, as long as the assignment occurs before the access in control flow (block) ordering
SSA ID assignments inside loop blocks are considered to be live until the next uniform block after the loop block the SSA ID assignment occurs in
2024-12-06 11:13:28 +00:00
Jake Turner 933772c3ec DXIL ControlFlow Updates added IsForwardConnection()
Cache 2D bool array of IsBlock B in any path ahead of Block A
2024-12-06 11:13:28 +00:00
Jake Turner 2e6368e6c2 DXIL ControlFlow optimisations, new APIs
Use rdcarray instead of unordered_map, unordered_set for hot containers
Made struct public and added new APIs

rdcarray<uint32_t> GetUniformBlocks();
rdcarray<uint32_t> GetLoopBlocks();
uint32_t GetNextUniformBlock(uint32_t from);
2024-12-06 11:13:28 +00:00
Jake Turner 4102b66ec0 DXIL Debugger Added m_Assigned container
To track/assert if an SSA ID is used before it has been assigned
2024-12-06 11:13:28 +00:00
Jake Turner 93bba6375d DXIL disassembly custom decode asint(), asfloat()
Before:
int _1374 = (int)(_1364); // bitcast
float _1377 = (float)(_1376); // bitcast

After:
int _1374 = asint(_1364); // bitcast
float _1377 = asfloat(_1376); // bitcast
2024-12-06 11:13:28 +00:00
baldurk 87547d6074 x86 compile fix 2024-12-06 11:04:19 +00:00
baldurk 70c6dd32a2 Implement auditing of indirect RT dispatches 2024-12-05 13:31:35 +00:00
baldurk bdd479a5d4 Use RT indirect estimate directly 2024-12-05 13:31:23 +00:00
baldurk 3366b25f0d Add appropriate barriers for indirect RT arguments during patching 2024-12-05 13:31:23 +00:00
baldurk dcf9ef00dc Fix missing flag to indicate that indirect count buffer is unused 2024-12-05 13:31:23 +00:00
baldurk e2f67eb9f6 Ignore a couple of DXBC chunks without processing or warning 2024-12-05 13:31:23 +00:00
baldurk a26e599c02 Rebase addresses to current form in indirect ray dispatches 2024-12-05 13:31:23 +00:00
baldurk 9d698acbf4 Reset lod bias on GL when rendering textures internally 2024-12-05 13:31:23 +00:00
baldurk 4bc41a6296 Fix nv aftermath include order 2024-12-05 13:31:23 +00:00
baldurk 9bc648cf3b Fix fetching DRED contexts
* Though these are broken as they are not properly processing BeginEvent strings
  which are not packed/encoded
2024-12-05 13:31:23 +00:00
baldurk 72fffe4cf2 Run patching for indirect RT executes while auditing, but don't execute 2024-12-05 13:31:23 +00:00
baldurk bd286fce81 Sort resources with identical start VAs by size
* This helps us when looking up a resource by VA to identify the largest one,
  though does not handle all cases :(.
2024-12-05 13:31:22 +00:00
Jake Turner fc31fb377e DXIL Debugger support for DXOp::CalculateLOD 2024-12-04 15:19:56 +00:00
Jake Turner c2f752aa29 DXIL Debugger support for CreateHandleFromHeap 2024-12-04 14:55:34 +00:00
Jake Turner 11870b184a ShaderViewer support for ShaderDirectAccess shader resources
i.e. D3D12 SM6.6 HLSL Dynamic resources which index directly into the resource/sampler heap and not via shader bindings.
2024-12-04 13:40:17 +00:00
Jake Turner 2bd74fea8e DXIL Debugger copy the type data from the Phi argument as well as values
To support the case when the Phi node argument is storing the result from a Handle operation i.e. CBufferLoad, Sample
2024-12-04 09:51:50 +00:00
Jake Turner 81816cc2f9 DXIL D3D12APIWrapper added GetShaderDirectAccess()
Creates ShaderDirectAccess structure from a DescriptorCategory and DXDebug::BindingSlot
2024-12-04 09:51:50 +00:00
Jake Turner 2d8930d88e Added D3D12APIWrapper::GetResourceReferenceInfo()
Gets the resource details for a direct heap access binding
2024-12-04 09:51:49 +00:00
Jake Turner 8d24385f15 D3D12ShaderDebug support for direct heap access bindings
Added:
D3D12Descriptor FindDescriptor(WrappedID3D12Device *device, const DXDebug::HeapDescriptorType heapType, uint32_t descriptorIndex);
2024-12-04 09:51:49 +00:00
Jake Turner 8e69038ebc Extend DXDebug::BindingSlot to support direct access heap bindings
Add new members
HeapDescriptorType heapType;
uint32_t heapIndex;
2024-12-04 09:51:49 +00:00
Jake Turner 140c681e66 DXIL Debugger new struct ResourceReferencceInfo for resource details
Replaces previous use of DXIL::ResourceReference* which is only available for direct bindings
2024-12-04 08:37:21 +00:00
Jake Turner dbe18fc7fe Added ShaderDirectAccess helper struct and ShaderVariable set/get
ShaderDirectAccess is used to reference resources which are accessed directly from the Shader (not via a direct binding). Shader resource references using direct binding are stored in ShaderBindIndex.
2024-12-04 08:37:21 +00:00
baldurk 61a559a944 Expand cases where we don't hook an already loaded module
* Some nv libraries like to do this a *lot* for nvapi.dll.
2024-12-03 17:11:21 +00:00
baldurk d37b0ee00b Fix issue with iterating actions via previous/next in python
* We keep parent references when returning child objects via reference/python
  object wrappers rather than copying. But when iterating a linked list like the
  actions this can produce an incredibly long parent chain and then on
  destruction we can stack overflow if the chain is long enough.
2024-12-03 15:01:58 +00:00
baldurk 8d04479d20 Add additional check on index buffer values being out of bounds 2024-12-03 15:01:58 +00:00
Jake Turner 3de21cd16f DXIL Debugger sort unimplemented DXOp's into three lists
1. Likely to implement when required
2. Don't know if needs to be implemented
3. No plans to implement
2024-12-03 06:20:36 +00:00
Jake Turner dc1a7c57db Update DXIL Global Shader Flags to latest version SM6.8
For the future display any unknown global shader flags as hex value
Make sure the DXIL debugger line numbers match the disassembly output if there are unknown global shader flags
2024-12-03 06:20:36 +00:00
Jake Turner 8b3a5ee826 DXIL Debugger helper methods to clear/set/get AnnotatedHandle property 2024-12-03 05:47:38 +00:00
Jake Turner 9abacbf6ea DXIL Debugger removed unused method DebugAPIWrapper::IsResourceBound()
Also removed associated private helper methods IsUAVBound(), IsSRVBound()
2024-12-03 05:45:50 +00:00
Jake Turner 4532b888ed Add SM 6.2 and StructuredBuffer<int16_t> to D3D12 Shader Debug Zoo test 2024-12-03 05:21:41 +00:00
Jake Turner 56fffb5dc2 D3D12 Tests add uint32_t compileOptions to Compile()
Current options are:
SkipOptimie : the default
Enable16BitTypes
2024-12-03 05:21:41 +00:00
baldurk 6d3e08a285 Don't check for transient file's existence 2024-12-02 13:57:41 +00:00
baldurk 06bc5818c2 32-bit compile fix 2024-12-02 13:54:52 +00:00
baldurk 537a19f639 Verify callable shaders (assuming anyone ever uses them) 2024-12-02 13:54:45 +00:00
baldurk 8ed3ff4db3 Increase D3D12 text rendering ring size
* The RT overlay can use a lot of lines per frame
2024-12-02 13:39:28 +00:00
baldurk 9d3d253642 Don't encode PNG extended thumbnail by default 2024-12-02 13:39:28 +00:00