Commit Graph

14588 Commits

Author SHA1 Message Date
Jake Turner bdc0a0bc2d RD DXIL Disassembly: explicit handling for specific FP comparisons
FOrdFalse
FOrdTrue
FOrd
FUnord
2024-04-23 11:23:20 +01:00
Jake Turner 9bb9c4ba6e RD DXIL Disassembly: use C-style operators and function names
Use C-style operators and function names as much as possible to replace comparison, arithmetic, casting instructions
2024-04-23 10:28:01 +01:00
Jake Turner 0f2c7490ce RD DXIL Disassembly: display function name instead of full signature
Divide up "funcSigs" array into "name" and "signature" arrays
2024-04-23 07:10:14 +01:00
Jake Turner 53e76cfa86 RD DXIL Disassembly: do not show Op flags string 2024-04-23 07:10:08 +01:00
Jake Turner f27659e902 RD DXIL disassebmly: do not show types on parameters 2024-04-23 07:10:03 +01:00
Jake Turner a9ead1dc0a RD DXIL disassebmly: display C style type names
i1 -> bool
i8 -> int8
i16 -> short
i32 -> int
i64 -> long
2024-04-23 07:09:56 +01:00
Jake Turner a8ccb73de8 First version of RenderDoc DXIL Disassembly output
Shows entry point inputs & outputs
Decodes "dx.op.loadInput" and "dx.op.StoreOutput" to show the input/output name
Change identifier prefix to "_" instead of "%"
Print floats in more natural format using %#g
Print type before assignments
2024-04-22 17:20:26 +01:00
baldurk 86ce562594 Use STAT dxil module for reflection where possible/necessary
* The STAT module has some metadata unstripped which is useful for type
  annotations. It's better than plain stripped DXIL but not as good as ILDB.
2024-04-22 16:21:51 +01:00
baldurk edcc7f7bbf Fix a couple of differences from dxc disassembly 2024-04-22 16:21:51 +01:00
Jake Turner 7c656e4881 Add DisassemblyAddNewLine() to make code simpler
Also keeps the current instruction line updated via new member
int m_DisassemblyInstructionLine;
2024-04-22 14:47:26 +01:00
baldurk 72095b8302 Create proper NULL descriptors for empty bindings in reflection zoo 2024-04-22 13:44:46 +01:00
baldurk c244c1fdda Don't process unused bindings when debugging vulkan shaders
* These will not be in the reflection data, so we can't try to process them and
  fill out their variables as there won't be anything to map to.
* Signature elements which are 'unused' by not being referenced but are present
  in a pre-1.4 SPIR-V module will be considered used still.
2024-04-22 13:01:13 +01:00
baldurk 020efd7fd7 Set subpass explicitly to 0 when using loadRPs 2024-04-22 13:01:13 +01:00
baldurk f03d73108f Add sorting offsets for arrays in SPDB source mapping data 2024-04-22 13:01:12 +01:00
baldurk 124218c6a3 Fix typo cutting off some of DXIL disassembly 2024-04-22 13:01:12 +01:00
Jake Turner 5cfff389fe SPIRV debug mapping updates to handle multiple overlapping mappings
Capture the mappings into a type usage tree
Update elements of the tree as overlapping mappings are encountered, sub-elements of a previously mapped variable i.e. single component of a vector, single array element, member in a structure.
After processing all mappings convert the finalized type usage tree into source variable mappings.
2024-04-22 12:52:12 +01:00
Jake Turner 6532eb65f0 SPIRV debug mapping change the superseding detection
Loop over the scope downwards (parent -> child) then inside that loop iterate upwards from the current scope (child -> parent) to detect mappings which might be superseded
2024-04-22 12:52:12 +01:00
Jake Turner cf66943092 SPIRV debugging: store the arrayDimensions for DebugTypeArray 2024-04-22 12:52:12 +01:00
Jake Turner d785eaeb67 Update struct member and array element names of SPIRV constants
array names and struct member names are not set when constants are created (struct decoration data is not available)
2024-04-22 12:52:12 +01:00
Jake Turner f494bb3cb9 Handle NULL signatures in DXIL EntryPoint 2024-04-22 12:08:31 +01:00
Jake Turner c2100ed816 Add DXIL 1.8 opcodes to funcSigs
Generated using DirectShaderCompile python file "utils/hct/hctdb.py"

    for inst in db.instr:
        out = inst.name
        out += "("
        for i in range(2,len(inst.ops)):
          if i > 2:
            out += ","
          op = inst.ops[i]
          out += op.name

        out += ")"
        print(out)
2024-04-22 11:47:32 +01:00
Jake Turner 218e52d0bb Move files to the 3rdparty/glslang filter in renderdoc_spirv vcproj 2024-04-22 11:46:53 +01:00
Jake Turner 08ed70e648 Added char DXIL::dxilIdentifier to use in the disassembly output
Before (DXC style)
%46 = fcmp fast olt float %45, 1.000000e-06

After (RD style)
_46 = fcmp fast olt float _45, 1.00000e-06;
2024-04-22 06:41:07 +01:00
Jake Turner 5cc7c3f417 Moved dxcStyle formatting parameter to static DXIL::dxcStyleFormatting
Disable dxcStyleFormatting when making RD disassembly
Change float printing to use "%#g" when dxcStyleFormatting is disabled

Before (DXC style)
  %7 = fmul fast float %4, 2.000000e+00
  %14 = fcmp fast olt float %13, 1.000000e-06

After (RD style)
  %7 = fmul fast float %4, 2.00000;
  %14 = fcmp fast olt float %13, 1.00000e-06;
2024-04-20 07:12:50 +01:00
baldurk bdc06af0de Add reflection of acceleration structures in DXIL & new descriptor type 2024-04-19 10:04:26 +01:00
baldurk c3b66e7984 Fix structured data display from the D3D12 build desc struct 2024-04-19 10:04:26 +01:00
Jake Turner 07ce326ce3 Added DXIL EntryPoint meta-data parsing 2024-04-18 16:29:00 +01:00
Jake Turner 22b0d53c42 Add DXIL enums for MatrixOrientation, SamplerFeedbackType 2024-04-18 16:12:05 +01:00
Jake Turner 9b88a7e933 Add extra DXIL struct member annotations
FieldWidth
VectorSize
SemanticName
2024-04-18 16:12:05 +01:00
Jake Turner 92a060ee70 Divide DXIL disassembly into two passes
First pass to settle the IDs common between disassembly styles
Second pass to display the disassembly
Divide existing MakeDXCDisassemblyString() method into helper methods to be shared
2024-04-18 16:12:05 +01:00
Jake Turner 3db925fd7a Add option for DXIL toString() helpers to use dxcStyle (default) 2024-04-18 16:03:58 +01:00
Jake Turner 62d3cd5f43 Ground work for RenderDoc specific DXIL disassembly view
Currently not exposed to the UI and code uses the existing DXC compatibile DXIL disassembly

Add bool parameter to DXBC::GetDisassembly()
Add bool parameter to DXIL::GetDisassembly()
Add void DXIL::MakeDXCDisassemblyString()
Add void DXIL::MakeRDDisassemblyString()
2024-04-18 15:46:39 +01:00
baldurk 70b7b770e8 Fix patching of BLAS addresses in TLAS build during replay 2024-04-17 15:32:23 +01:00
baldurk 1bd2b3976e Add forced references for ASs and mark all ASBs referenced 2024-04-17 15:32:23 +01:00
baldurk 5025304905 Add handling for AS SRV descriptors
* We treat these just as buffers for now.
2024-04-17 15:32:23 +01:00
baldurk 09a662c2e2 Add simple API-serialised initial states for acceleration structures 2024-04-17 15:32:23 +01:00
baldurk 258ab0a229 Record a fake creation for D3D12 AS objects to create them at load time 2024-04-17 15:32:23 +01:00
baldurk abbfe59b79 Add ray dispatch execute indirect argument serialisation 2024-04-17 15:32:23 +01:00
baldurk e0327b6c60 AS rebuilds are considered successful and shouldn't throw an error 2024-04-17 15:32:22 +01:00
baldurk b2d07cb56e Call serialise function for AS builds 2024-04-17 15:32:22 +01:00
Jake Turner bd0c961b94 D3D12: RenderMesh use the correct size for Vertex, Index Buffers
Fixes debug errors "exceeds end of the virtual address range of Resource" i.e.

D3D12 ERROR: ID3D12CommandList::IASetVertexBuffers: 0x0000023B9A746190 + SizeInBytes - 1 (0x000000010c36bffe) exceeds end of the virtual address range of Resource (0x0000023B9A746190:'PostVS vsoutBuffer for 162', GPU VA Range: 0x000000000c36c000 - 0x000000000c36c29f).  [ EXECUTION ERROR #726: SET_VERTEX_BUFFERS_INVALID]
D3D12 ERROR: ID3D12CommandList::IASetIndexBuffer: pDesc->BufferLocation + SizeInBytes - 1 (0x000000010c36affe) exceeds end of the virtual address range of Resource (0x0000023B9A7479B0:'PostVS idxBuf for 162', GPU VA Range: 0x000000000c36b000 - 0x000000000c36b00b).  [ STATE_CREATION ERROR #725: SET_INDEX_BUFFER_INVALID]
2024-04-17 11:44:06 +01:00
baldurk 78e84aa544 Don't crash on empty descriptor sets with no bindings 2024-04-16 20:03:54 +01:00
baldurk d4b8504bdc Add instructions to documentation on enabling the Nsight perf SDK 2024-04-16 11:04:58 +01:00
Jake Turner b72e506cf5 D3D12 PixelHistory: improve detection and handling of depth targets
Use D3D12_RESOURCE_DESC Flags to detect depth target (D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL).
Use GetDepthTypedFormat() to get correct depth copy format.
Use Pixel History IsDepthFormat() internal method instead of using DXGI_FORMAT helper function "IsDepthFormat".
Fixes issue of pixel history on typeless target cast to UNORM and used as depth i.e. R16_TYPLESS, cast to UNORM used as a shadow map
2024-04-15 16:54:53 +01:00
Jake Turner 4b9284ed8f PixelHistory UI: improve detection of depth targets
Use the same logic as TextureViewer to determine if the target is a depth target
Fixes issue of pixel history on typeless target cast to UNORM and used as depth i.e. shadow map
2024-04-15 16:54:53 +01:00
baldurk ade34bb59d Disallow dedicated memory on external images where memory reqs change 2024-04-15 16:23:08 +01:00
luckyxxl 3c265b8ad0 Add missing Indirect resource usage for indirect draw count buffers
The buffer containing the `uint32` draw count value for indirect draws with count was not marked as used for the respective events for the following API calls: glMultiDrawArraysIndirectCount, glMultiDrawElementsIndirectCount, vkCmdDrawIndirectCount, vkCmdDrawIndexedIndirectCount, vkCmdDrawMeshTasksIndirectCountEXT.
2024-04-15 16:20:18 +01:00
Jacob Thomas 7e976c04a8 Fix 'android-<version>.jar' search path on MacOS
The renderdoccmd android build assumes all files in '${ANDROID_SDK_ROOT_PATH}/platforms' are valid 'android-<version>.jar' platform libraries. Unfortunately because MacOS litters its directories with metadata files called .DS_Store, that file actually wins this sorting logic and is incorrectly selected.
This fixes the lib search logic to only consider android libraries.
2024-04-15 16:18:15 +01:00
Jake Turner bea0621625 Metal updates for MacSDK 14.4
Add MTLResource::setOwnerWithIdentity to ObjCBridgeMTLTexture and ObjCBridgeMTLBuffer
2024-04-13 16:17:57 +01:00
Jake Turner 1a85fcffba Sync demos copy of metal-cpp.h to match RenderDoc version 2024-04-13 07:31:58 +01:00