Commit Graph

14834 Commits

Author SHA1 Message Date
baldurk 928048b786 Tweak entrypoint disassembly to work better for large interface lists 2024-06-26 17:07:09 +01:00
baldurk 187ab5726a Update helpers with all shader stages 2024-06-26 17:07:09 +01:00
baldurk cd8e6b7bde Fix state handling for new pipeline bind point 2024-06-26 17:07:09 +01:00
baldurk 1b6e09430e Implement ray dispatch functions on Vulkan 2024-06-26 17:07:09 +01:00
baldurk 00b07693a6 Treat ray dispatches as dispatches for action callbacks 2024-06-26 17:07:09 +01:00
baldurk 6fa26849cd Implement RT pipeline creation & capture/replay handle folding in 2024-06-26 17:07:09 +01:00
baldurk 9e521e29a6 Implement struct handling and function stubs for RT pipelines 2024-06-26 17:07:08 +01:00
Jake Turner 3373f4b50e DXIL Reflection for compute shaders correctly detect threadIdInGroup
Searches for "dx.op.threadId" was also incorrectly matching "dx.op.threadIdInGroup"
2024-06-26 08:41:35 +01:00
Jake Turner 419d321a4a RD DXIL Disassembly add compute shader inputs and thread group size
e.g.

[numthreads(3, 2, 1)]
void main()
{
  InitialiseHandle(bufOut); //  index = 1
  InitialiseHandle(bufIn); //  index = 0
  InitialiseHandle(consts); //  index = 0

Inputs
  float3 threadId;

Inputs
  float flattenedThreadIdInGroup;
2024-06-26 08:27:56 +01:00
Jake Turner 6cddf16263 DXIL Shader Debugger call FillTraceLine() for DXBC and DXIL debugging
Some lines of the disassembly output come from DXBC parsing and need to account for that in the trace line info
2024-06-26 06:17:57 +01:00
Jake Turner c49d688f13 DXIL Disassembly ParseReferences tweaks for CreateHandleFromBinding
Handle the constant binding struct being NULL which means all its members are zero
2024-06-26 06:16:24 +01:00
baldurk 12518fda49 Remove PIPELINE_COMPILE_REQUIRED flag on compute pipelines too 2024-06-25 18:56:27 +01:00
Jasmine Hansen 33d81cc1cc Enable VK_EXT_shader_object 2024-06-25 17:55:10 +01:00
Jasmine Hansen 244aef2f76 Prevent pixel history crash with shader objects 2024-06-25 17:55:10 +01:00
Jasmine Hansen cb951ba689 UI support for shader objects
Info queries for pipeline state viewer and descriptor sets
Shader editing
2024-06-25 17:55:10 +01:00
baldurk 78d267a1d4 Don't continually expand a constant buffer view if it's re-opened solo 2024-06-25 17:25:16 +01:00
baldurk 1ec36140bf Ensure push constant command buffer is always registered
* We still want to have a ResourceId for a command buffer to reflect push
  constants - it doesn't matter which command buffer it is currently. If push
  constants are present, but never pushed, we should still reflect it.
2024-06-25 17:25:16 +01:00
baldurk 0943d8882f Harden descriptor access handling on both sides of the replay API
* Avoid generating bad descriptor accesses in the first place, and make the
  pipeline state more robust in that case so that it doesn't crash.
2024-06-25 17:25:16 +01:00
baldurk 499da16b45 When doing an action callback for a sub-region, don't replay whole EI 2024-06-25 17:25:15 +01:00
baldurk a90d3eb9c8 Account for padding in argument constant buffer for EI patching 2024-06-25 17:25:15 +01:00
baldurk 1a1437ee19 Fix ExecuteIndirect state decoding not properly respecting stride
* It was also broken even for tightly packed argument signatures because it
  wasn't incrementing the data pointer over the dispatch/draw arguments.
2024-06-25 17:25:15 +01:00
baldurk e2a03f5d23 During capture use application's device configuration for root sigs
* If we don't, we'll try to use the builtin root sig decoder and possibly break.
2024-06-25 17:25:15 +01:00
Cam Mannett bc94410ece Provide fallbacks within POSIX GetHomeFolderFilename()
There are scenarios (specifically when running in anonymous containers) where there is no entry in the password file for the current user, this causes getpwuid() to return a NULL pointer promptly causing a segfault.

This change detects this and then attempts to read the $HOME env var, and if that fails it falls back to the temp dir.  Although the temp dir is not valid as a home dir, it is a valid path and so can be used by the calling function.
2024-06-25 09:56:26 +01:00
baldurk 4648ef27f9 Serialise and replay calls to SetPipelineStackSize 2024-06-24 15:35:04 +01:00
baldurk 01384c4d42 Update vulkan headers to 1.3.288
* Add support for VK_KHR_shader_relaxed_extended_instruction which is trivially
  supportable
2024-06-24 12:48:13 +01:00
baldurk 217d52da2a Update SPIR-V headers and allow OpExtInstWithForwardRefsKHR
* For our purposes we can trivially treat this as equal to OpExtInst since we
  mostly don't care about forward references and don't use the debug information
  where forward references are likely to be generated (class member function
  type information).
2024-06-24 12:10:51 +01:00
baldurk b6bc8fe80f Use same disambiguation selection for resources in all cases
* We use a different function for serialising addresses via ID+offset compared
  to the normal lookup, since on serialise we need to allow out of bounds
  references as that's legal in D3D12 too. If we have a mismatch here we could
  mark one buffer referenced but serialise as another and be unable to translate
  the address.
2024-06-24 11:34:51 +01:00
baldurk 34003e96c6 Use correct command list on replay for AS build and copy commands 2024-06-21 16:42:12 +01:00
baldurk 51c13435f5 Use the largest possible resource when resolving addr -> resource
* There is ambiguity here and it seems that sometimes the runtime will care
  about which resource is picked even if they overlap.
2024-06-21 16:42:12 +01:00
baldurk 0cc4cdedb6 Fix divide by zero if stride is 0 2024-06-21 16:42:12 +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
Jake Turner 1dbd64c791 Set DXC arguments in D3D12ShaderCache::GetShaderBlob()
Convert ShaderCompileFlags to DXC arguments
2024-06-20 13:03:31 +01:00
Jake Turner e8ecf2cccb Added D3D11 Pixel History test for pixel shader UAV Write 2024-06-20 11:55:30 +01:00
Cam Mannett 381ece60c6 Non-local child removal fix
The frontend compares the registered child PIDs against the locally running ones, any that aren't in the list are removed - this is how dead procs are removed.  Unfortunately this causes any children from a remote context to be immediately removed.

After discussion with upstream, the agreed solution was to prevent child removal entirely for remote contexts as long as clicking on dead children does nothing.
2024-06-20 11:40:26 +01:00
Jovan Ristic a765ef025d Fix lack of PS UAVs in d3d11 pixel history.
* When a non-zero UAVStartSlot is present, the index in the array and
the slot in the shader do not line up.
* This fixes both the listing for "Usage in Frame" and pixel history
results.
2024-06-20 11:34:53 +01:00
Jovan Ristic 2ee03b3691 Correct usage of shader names.
* GL/Vulkan and D3D11/D3D12 were using reversed terminology.
2024-06-20 11:34:53 +01:00
Jake Turner b6c2824e0f DXIL Disassembly added variable for name of fake input/output structs 2024-06-19 06:46:24 +01:00
baldurk f74a119e05 Remap addresses to live in indirect dispatch on replay 2024-06-18 16:46:12 +01:00
baldurk a8281e91da Demote error to warning for tier 3 descriptor exhaustion
* This is sadly common enough that we will hit it regularly on many D3D12
  programs that just allocate the maximum number of descriptors.
2024-06-18 16:46:12 +01:00
Jasmine Hansen 1ca3f26726 Fix replaying shader object dynamic vertex binds 2024-06-18 13:50:22 +01:00
Jasmine Hansen b8f0196580 Add quad overdraw and tri-size overlay support with shader objects 2024-06-18 13:50:22 +01:00
Jake Turner 8a2d483b40 Update D3D12 ExecuteIndrect argOffset during replay
This fixes D3D12_Execute_Indirect test failure

Only add to m_Cmd->m_RayDispatches when ray tracing is active in the execute indirect
2024-06-17 12:03:51 +01:00
Jake Turner 1ae6882c90 Updated python setup documentation to include instructions for "VS Code" 2024-06-17 10:41:38 +01:00
Jake Turner be0a6ff962 Added DXIL helpers IsDXCNop(), IsSSA(), IsLLVMDebugCall()
IsDXCNop() checks for DXC Nop generated instructions, which take the form of a Load from a global variable called "dx.nothing.*"

IsSSA() checks if a DXIL::Value is an SSA value i.e. from an instruction, not a constant etc.

Store function name from Operation::Call in a const reference instead of making a copy
2024-06-17 10:41:38 +01:00
Jake Turner 49d8c791de DXIL Disassembly rework resource handle display
AnnotateHandle
* Change the SSA result name to be "_typed_descriptor_<N>"
* Show the input handle SSA name instead of the resource alias name

CreateHandleFromHeap
* Change the SSA result name to be "_untyped_descriptor_<N>"

CBufferLoad, CBufferLoadLegacy
* For SM6.6 use the handle alias instead of the cbuffer name

Before:

  _dx.types.Handle _3 = ResourceDescriptorHeap[8];
  _dx.types.Handle __heap_descriptor_0 = (StructuredBuffer<stride=8>)ResourceDescriptorHeap[8];
  _dx.types.Handle _11 = SamplerDescriptorHeap[0];
  _dx.types.Handle __heap_descriptor_1 = (SamplerState)SamplerDescriptorHeap[0];
  _dx.types.Handle _15 = ResourceDescriptorHeap[12];
  _dx.types.Handle __heap_descriptor_2 = (Texture2D<4xF32>)ResourceDescriptorHeap[12];
  _dx.types.ResRet.f32 _19 = __heap_descriptor_2.Sample(__heap_descriptor_1, _.i05, _.i16, Offset = {0, 0});

After:

  _dx.types.Handle __untyped_descriptor_0 = ResourceDescriptorHeap[8];
  _dx.types.Handle __typed_descriptor_0 = (StructuredBuffer<stride=8>)__untyped_descriptor_0;
  _dx.types.Handle __untyped_descriptor_1 = SamplerDescriptorHeap[0];
  _dx.types.Handle __typed_descriptor_1 = (SamplerState)__untyped_descriptor_1;
  _dx.types.Handle __untyped_descriptor_2 = ResourceDescriptorHeap[12];
  _dx.types.Handle __typed_descriptor_2 = (Texture2D<float4>)__untyped_descriptor_2;
  _dx.types.ResRet.f32 _19 = __typed_descriptor_2.Sample(__typed_descriptor_1, _.i05, _.i16, Offset = {0, 0});
2024-06-17 10:41:38 +01:00
Jake Turner fc1e5bb1ad DXIL Disassembly use RD variable type output in AnnotateHandle
i.e.
Texture2D<4xF32> -> Texture2D<float4>
2024-06-17 10:35:57 +01:00
Jake Turner 9825057527 DXIL Disassembly show dx.op.CreateHandle as "InitialiseHandle(...)"
Before

  _dx.types.Handle _bufOut_UAV_structbuf = bufOut;

After

  InitialiseHandle(bufOut);
2024-06-17 10:35:46 +01:00
baldurk d12f5fb5a8 Stop clamping available tier 2024-06-13 14:38:47 +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