Commit Graph

14993 Commits

Author SHA1 Message Date
Jake Turner 82005c8fee DXIL Debugger support code in D3D12_ShaderDebug.cpp
Code is effectively disabled because DXIL GetDebugStatus() returns "Debugging DXIL is not supported"
Includes minimum required helper structs/methods in DXIL Debugger
2024-09-13 15:31:36 +01:00
Jake Turner d1f69b5c72 DXIL Debugging D3D12APIWrapper
Includes minimum required helper structs/methods in DXILDebug
2024-09-13 15:03:31 +01:00
Jake Turner 772be86ec4 DXIL Source File and Line Debug Data 2024-09-13 14:46:48 +01:00
Jake Turner f8ddc1720a Added prototype of DXIL Source Variable Debug Data 2024-09-13 14:43:04 +01:00
Jake Turner 881e5e8e03 Added DoStringise() for DXIL::DW_OP 2024-09-13 14:40:28 +01:00
baldurk eed31e2a09 Fix compute shader handling of implicitly-set unspecified root signature
* Previous commit 304e636 fixed this for most cases but was incorrect for
  compute PSOs.
2024-09-13 13:22:04 +01:00
baldurk 51baf8a6af Add test of implicit compute shader root signature 2024-09-13 13:22:03 +01:00
baldurk 457e91f194 Make sure root signatures *precisely* patch between HLSL and code
* Also don't finish with the backbuffer too early and re-bind VB after execute
  indirect.
2024-09-13 13:22:03 +01:00
baldurk f689b23024 Don't run D3D12 singleton device test if we're using new device creation 2024-09-13 13:22:03 +01:00
Jake Turner 1cc0fd0323 D3D12 Shader Debug preparation for DXIL Pixel Shader Debugging
Move pixel shader debugging code which is shared by DXBC/DXIL to outside of if DXBC scope
2024-09-10 14:59:04 +01:00
Jake Turner 2dad8233a3 Added more DXIL Debug Info helpers, made debug info helpers const
rdcstr GetDebugScopeFilePath(const DIBase *d) const;
uint64_t GetDebugScopeLine(const DIBase *d) const;
const Metadata *GetDebugScopeParent(const DIBase *d) const;
2024-09-10 14:59:04 +01:00
Jake Turner 7b2754a978 Santisie the shader source filenames in DXIL BuildReflection
Reset Files and m_CompileFlags to avoid accumulation with repeated calls to BuildReflection
Set "preferSourceDebug" to "1" if the DXIL has source file data
2024-09-10 14:59:04 +01:00
Jake Turner f730eb6659 Add helper: rdcstr standardise_directory_separator(const rdcstr &path);
Replaces all directory separators combinations with '/'
i.e.
'\' -> '/'
'//' -> '/'
2024-09-10 14:59:03 +01:00
Jake Turner e7e3f00508 Move DXIL SSA ID for function arguments outside of instructions loop 2024-09-10 14:59:03 +01:00
Jake Turner a6bcd8c472 Added DoStringise for DXIL::LLVMDbgOp and DXIL::DIBase::Type 2024-09-10 14:59:03 +01:00
Jake Turner b245917867 Renamed DXIL::Program::GetReflection() to BuildReflection() 2024-09-10 14:59:03 +01:00
Jake Turner 8745c399ad Extended existing shader model coverage to include 6.0, and 6.6
Added Compute shader test for SM 6.0 and SM 6.6
Added very basic vertex shader test to the triangle rendering for each SM
2024-09-10 14:59:03 +01:00
Cam Mannett de07e66728 Use GLSL 460 for built-in spirv-cross -> GLSL calls
spirv-cross defaults to 450 but will not parse shaders containing the RayQuery capability unless the version is set to 460.

This change modifies the built-in GLSL cross tool to set `--version 460`.  This change does not affect user-specified spirv-cross configurations.
2024-09-10 12:16:08 +01:00
baldurk 407c74de01 Fixed an issue with indirect count and secondary command buffers
* Added logic to shift the beginEvent for any command nodes that occur after a
  draw indirect count action within a command tree.
2024-09-09 14:45:30 +01:00
baldurk 178b733001 Add helper for loading a shader module from disk in tests 2024-09-09 14:45:30 +01:00
baldurk 1ca4b70bf9 Display quad overdraw as disabled when MSAA is enabled on vulkan
* No API supports the quad overdraw with MSAA, but on other APIs it's feasible
  to downgrade and render the overlay at single sampled. On Vulkan with
  renderpasses this is not possible.
2024-09-09 14:45:30 +01:00
baldurk 3c6520d250 Add support for multiview with quad overdraw overlay. Closes #3424
* We multiply the internal array image up by the number of views and read from
  viewindex to write and resolve from different sets of slices
2024-09-09 14:43:17 +01:00
baldurk c7b0c240e2 Fix deferred handles to start properly from the upper bits
* INTPTR_MAX may overlap with valid pointers on android
2024-09-07 12:37:23 +01:00
baldurk 546490c1a6 Add a unit test for strip_nonbasic 2024-09-06 16:42:11 +01:00
baldurk bd62fb9a1d Release all internal pointers in wrapped device configuration 2024-09-06 16:42:11 +01:00
baldurk 5fe6b5c8e2 Print file & line for error-checked return codes 2024-09-06 16:42:10 +01:00
Cam Mannett f6327194bc Switch to a ref-counted solution 2024-09-06 16:38:43 +01:00
Cam Mannett b730e55b93 Vulkan AS rebuild-on-replay: On queue submission completion events
If an AS build command is called on an already built AS (i.e. an update build) then we need to safely destroy the previously copied input buffers and their memory.  However at the point this happens, we do not own the command buffer so we don't know if the original data has actually been copied yet.

Using the mechanism in this patch we associate function objects with the command buffer that will be executed when the queue the command buffer is submitted to, has finished executing on the GPU.

This works by carying the function objects in command buffer and once it is submitted, we poll on a VkEvent we inserted.  Once signalled, we call the function objects in the order they were inserted.
2024-09-06 16:38:43 +01:00
baldurk 677bc4701f 32-bit compile fix 2024-09-04 17:22:27 +01:00
baldurk 05ac8bed37 Update to latest DX headers and block workgraph functionality 2024-09-04 16:35:06 +01:00
baldurk bb6c6d84b2 Fix deferred pipeline compilation & naming on vulkan 2024-09-04 13:23:52 +01:00
baldurk 1402c5c417 Compile fix for use of sqrt 2024-09-03 17:00:49 +01:00
baldurk 076e07912d Add test of implicit embedded root signatures 2024-09-03 15:00:35 +01:00
baldurk 282e76a2f5 Defer state object compilation on D3D12 2024-09-03 14:22:01 +01:00
baldurk d7f3f194da Defer normal pipeline object compilation on D3D12 2024-09-03 14:22:01 +01:00
baldurk 54ee4217b9 Defer pipeline compilation on Vulkan to jobs 2024-09-03 14:22:01 +01:00
baldurk c4e9ef1d77 Add the ability to defer a wrapped handle during replay temporarily
* We create a fake handle to provide to the wrapping system which will be non-
  functional, and then later on update the mapping information once the real
  handle has been patched in.
* On vulkan we don't know what valid handles might be but we assume they will
  likely be pointer-like, so we start from -1 and move downward with the fake
  handles to avoid a clash (which would break).
2024-09-03 14:22:00 +01:00
baldurk 8826c96454 Initialise job system on Vulkan & D3D12
* We only expect to use jobs currently for the loading portion before the frame
  capture scope, so we synchronise on jobs and process any deferred failures
  immediately after applying initial contents and before doing the first frame
  capture replay.
2024-09-03 14:22:00 +01:00
baldurk a784c9a1a7 Add unit tests for the job system 2024-09-03 14:22:00 +01:00
baldurk 69a92bbc84 Add job system for deferring tasks in parallel 2024-09-03 14:22:00 +01:00
baldurk abdc3c2b4f Fix android compilation 2024-09-02 18:10:37 +01:00
baldurk 8592fc0cc3 Fix compilation on 32-bit 2024-09-02 18:08:04 +01:00
baldurk a886489c8c Don't rely on descriptor heap being present when processing descriptor
* This may not be true for RTV/DSV where the descriptor heap is purely an API
  design wart and may not actually exist when processing.
2024-09-02 17:30:25 +01:00
baldurk 08ec78aace Fix incorrect command buffer used to restore state after AS build 2024-09-02 17:30:25 +01:00
baldurk 7940e86ec3 Switch to use manual encoding/decoding of root signatures
* This removes the dependency on the serialisers/deserialisers provided by
  D3D12.dll or the D3D12Core.dlls
* It also allows us to easily decode root signatures that don't have DXBC
  containers, such as those in embedded subobjects.
2024-08-30 13:41:21 +01:00
baldurk 71043aa19c Add a unit test to comparison-test against the dll serialisers
* Since the serialised format is mostly memcpy'd we don't aim for complete
  coverage but just edge cases like empty lists, all different types of
  descriptors and flags, and all root signature versions.
2024-08-30 13:40:03 +01:00
baldurk d594538459 Add a custom decoder/encoder for D3D12 root signatures
* Handles v1.0 - v1.2 (v1.2 is undocumented/unspecified in DXC but assumed from
  changes & tested).
2024-08-30 13:35:39 +01:00
baldurk 2eb41f860d Add DXBC container helpers for manipulating single-chunk containers 2024-08-30 13:28:40 +01:00
baldurk 632cf5af46 Fix default descriptor flags for 1.0 root signatures 2024-08-30 11:55:24 +01:00
baldurk 68e18d2520 Fix incorrect chunk stringise 2024-08-30 11:54:09 +01:00