Commit Graph

14704 Commits

Author SHA1 Message Date
baldurk 02781658c8 Add ; for conditional branches in RD DXIL disassembly 2024-05-20 14:51:44 +01:00
baldurk c475053489 Move demangling function to utility helper in DXBC 2024-05-20 14:51:22 +01:00
baldurk 54b425e92e Fix crash disassembling library with dummy entry point 2024-05-20 14:51:03 +01:00
baldurk 38a7c7b338 Don't print inner type for ASs in DXIL disassembly 2024-05-20 14:50:47 +01:00
baldurk ddb0c9532e Remove fairly spammy debug log 2024-05-20 13:54:08 +01:00
baldurk 3d4ec46dc1 Always update shadow storage even on first allocation on GL 2024-05-19 23:56:01 +01:00
baldurk 1ad23f64ca Use hack to customise expander colour in treeview branches. Closes #3319 2024-05-17 11:41:53 +01:00
baldurk 1019b7f2cb Fix unwrapping and replay of AddToStateObject 2024-05-17 11:39:51 +01:00
baldurk 4ba41dae23 Add [allow_uav_condition] tag to compile on older versions of fxc 2024-05-17 11:39:51 +01:00
baldurk 4af980f8d4 Handle a stride of 0 in shader record tables 2024-05-17 11:39:51 +01:00
baldurk 0124a3d661 Fix D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS serialisation 2024-05-17 11:39:51 +01:00
Firestar99 db553fc6a6 fixed assert if task and mesh shader entrypoint name differed 2024-05-16 18:15:09 +01:00
Jasmine Hansen 5eac79c19c Remove the setting of rasterization samples in vkCmdSetSampleMaskEXT 2024-05-16 10:55:11 +01:00
Jake Turner d176e98fd5 RD DXIL Disassembly use DxOp enum values instead of string comparison
Added "dxOpFunctionNames" array to assert that the function name is as expected
2024-05-15 07:08:20 +01:00
Jake Turner 2e2e09097c Extended DXIL::DXOp with all the known enum values
Changed enum names to follow DXC convention
2024-05-14 17:44:58 +01:00
Jake Turner bd6da14c7a RD DXIL Disassembly initial value for m_DisassemblyInstructionLine 2024-05-14 14:58:32 +01:00
Jake Turner 78a548ad2b DXIL::Program header clarified IDebugInfo interface boundary 2024-05-14 12:45:25 +01:00
Jake Turner 080c0b052e DXIL::Program added function to ProcessFunctions via callback
void ProcessFunctions(std::function<bool(const Function *)> callback) const;
2024-05-14 12:45:21 +01:00
Jake Turner 2329e68f26 RD DXIL Disassembly refactoring to support DXIL Debugging
Added:
  void Parse(const DXBC::Reflection *reflection);
  void ParseReferences(const DXBC::Reflection *reflection);
  const ResourceReference *GetResourceReference(const rdcstr &handleStr) const;
  rdcstr GetResourceReferenceName(ResourceClass resClass, const BindingSlot &slot) const;

Changed:
  void FetchEntryPointInterfaces(rdcarray<EntryPointInterface> &entryPointInterfaces);
to
  void FillEntryPointInterfaces(); and store the entry point interface data in new member variable "m_EntryPointInterfaces"

To get the SSA names for handles that are referenced by createHandle calls

Added DoStringise() for DXIL::ResourceClass
2024-05-14 10:00:58 +01:00
Jake Turner fde1a19cb7 D3D12 Shader Debug only call FillTraceLineInfo for DXBC debugging
DXIL debugging will generate the line info data during DXILDebug::BeginDebug()
2024-05-14 08:41:55 +01:00
baldurk 22ffd90382 Fix shader editing being broken on compute pipelines by 3b2bb46 2024-05-13 16:35:55 +01:00
baldurk 0aa7cdda17 Set informational chunkIndex attribute on XML export
* This is useful to be able to tie a particular chunk when replaying to its
  location in the XML, where event IDs are hard to come by.
2024-05-13 16:35:55 +01:00
baldurk b9806addb1 Clamp RT tier to 1.0 until ExecuteIndirect support is done 2024-05-13 16:35:55 +01:00
baldurk 53b21a1072 Don't patch hitgroup/callable tables if not present
* The runtime seems to complain about an invalid address if it's at the end of a
  buffer even if the size is 0 bytes
2024-05-13 16:35:55 +01:00
baldurk 96da861a40 Patch root GPUVA parameters during replay 2024-05-13 16:35:55 +01:00
baldurk 464016bc29 Fix unwrapping of collection objects during capture 2024-05-13 10:50:56 +01:00
baldurk 369cc37446 Ignore NULL BLAS pointers 2024-05-13 10:50:55 +01:00
baldurk 729fa04136 Don't release ASs on replay
* These resources are destroyed on capture shutdown and possibly out of order
  between ASs and ASBs. The ownership tracking is not needed on replay so only
  do this during capture.
2024-05-13 10:50:55 +01:00
baldurk 72491cb9b2 Reset root signature elements when tracking during capture 2024-05-13 10:50:55 +01:00
Jasmine Hansen 23a2107fc2 Add initial shader object state to VulkanCreationInfo
Added function ShaderObject::Init to initialize VulkanCreationInfo::ShaderObject, and associated shader module.

Co-authored-by: James Sumihiro <james.sumihiro@ntd.nintendo.com>
2024-05-13 10:38:54 +01:00
Jake Turner 69bc0eaa47 Added Empty DXIL Shader Debugger helper files to the project
renderdoc/driver/d3d12/d3d12_dxil_debug.[h,cpp]
Will contain replay helper functions for DXIL debugger including the wrapper for D3D12 API interaction i.e. "DXILDebug::D3D12APIWrapper"
2024-05-11 13:28:52 +01:00
Jake Turner 2dcb0d0364 RD DXIL Disassembly: tweaks to label formatting
Add the DXIL::Identifier before labels for consistency
Do not display predicate "_0"
Change predicate column to 30 instead of 50
2024-05-11 07:05:02 +01:00
Jake Turner 139167a001 RD DXIL Disassembly: Use HLSL intrinsic names where possible for dx.op.* 2024-05-11 06:49:50 +01:00
Jake Turner 8a5b5754fd RD DXIL Disassembly: fix type decoding for arrayed resources
Before

Texture2D<Texture2D<vector<float, 4> >[0]> bindlessTexture2D[] : register(t0, space4);

After

Texture2D<float4> bindlessTexture2D[] : register(t0, space4);
2024-05-11 06:11:19 +01:00
baldurk e1283a7440 Handle root signature ranges that bind a subset of a binding array 2024-05-10 10:29:42 +01:00
William Pearson 3b2bb46d9a Don't replace shaders for incomplete pipeline libraries
Before, RenderDoc would treat these incomplete pipeline libraries as if
they were complete pipelines, and thus attempt to create pipelines with
incomplete data, producing several validation errors and on some devices
crashes.

For instance, a pipeline library that only contains a vertex or fragment
shader but not input assembly state would use invalid input assembly
state (specifically, VulkanShaderCache::MakeGraphicsPipelineInfo would
use the topology value from VulkanCreationInfo::Pipeline, which is set
to VK_PRIMITIVE_TOPOLOGY_MAX_ENUM (0x7fffffff) if the pipeline has no
input assembly state by VulkanCreationInfo::Pipeline::Init).

Additionally, those pipeline libraries were treated as complete graphics
pipelines, not libraries, as VulkanShaderCache::MakeGraphicsPipelineInfo
removes VK_PIPELINE_CREATE_LIBRARY_BIT_KHR and no
VkGraphicsPipelineLibraryCreateInfoEXT was added to the pNext chain.

RenderDoc already merges the pipeline libraries into complete graphics
pipelines, so there is no reason to recreate the libraries with modified
shaders.
2024-05-10 09:53:10 +01:00
Jasmine Hansen 91c13a0e9f Implemented vkGetShaderBinaryDataEXT.
Added logic to return a fake UUID for shader binaries if vkGetShaderBinaryDataEXT is called.

Co-authored-by: James Sumihiro <james.sumihiro@ntd.nintendo.com>
2024-05-10 09:35:41 +01:00
baldurk 2e2b9d2cf9 Add support for AddToStateObject 2024-05-09 15:00:30 +01:00
baldurk 913e4b680d Pass wrapped subobjects to export database initialisation 2024-05-09 15:00:30 +01:00
baldurk 088fc3e1f6 Fix handling of implicit default local root signatures in state objects 2024-05-09 15:00:30 +01:00
baldurk 9b3861a97f Fix loop looking up shader record offset 2024-05-09 15:00:30 +01:00
baldurk 84dc120871 Fix GPU patching of handles in local root signatures 2024-05-09 15:00:30 +01:00
baldurk 731f137e2f Destroy ASs when the ASB backing them is destroyed 2024-05-09 15:00:30 +01:00
baldurk b41d4159ce Use unmangled names for looking up shader identifiers 2024-05-09 15:00:30 +01:00
baldurk ace23d3f61 Actually remove export databases when unregistered 2024-05-09 15:00:30 +01:00
baldurk 4001d197e1 Serialise handle base for descriptor heaps to GPU unwrap on replay 2024-05-09 15:00:30 +01:00
baldurk 25f7eff9a3 Add support for AS copies on D3D12
* Most of these - all but a clone - require us to wait for the GPU execution to
  finish to get the size of the resulting AS to update our tracking. We issue a
  fence from the queue at submission time and then leave the RT manager to check
  for updates on each submission to get the latest information.
2024-05-09 15:00:30 +01:00
baldurk cc3b2f6443 Add post-submission AS build callbacks that need to wait for GPU sync
* This will be needed for copies where the size may not be known on the CPU -
  currently for AS builds we know the size directly.
* We also only store the size of an AS not the whole pre-build info since we
  don't need the scratch data and it won't be available in full for copies.
2024-05-09 15:00:29 +01:00
Jake Turner 75810b983c DXIL Shader Debug paths for DebugThread/DebugVertex/DebugPixel
The DXIL paths should not be executed and currently populated with error messages that DXIL debugger support is missing.
2024-05-09 12:36:45 +01:00
Jake Turner c54299f63f Added "DXBCContainerDebugger" to wrap DXBC or DXIL shader debugger
DXBC and DXIL Shader Debugger's inherit from "DXBCContainerDebugger : public ShaderDebugger".
"DXBCContainerDebugger" has member variable "isDXIL" to be able to choose if DXIL or DXBC ShaderDebugger is active and allow the correct cast from "ShaderDebugger" to be made.
Added stub of DXILDebug::Debugger in new files "drivers/shaders/dxil/dxil_debug.[h,cpp]"
2024-05-09 12:36:45 +01:00