Commit Graph

14960 Commits

Author SHA1 Message Date
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
baldurk f8a067b709 Return settings by value with temporaries
* This is slightly less efficient but this isn't high-performance code, and it
  makes settings like shader debug SearchDirPaths safe to access on multiple
  threads.
2024-08-30 11:54:09 +01:00
baldurk f3c10de41c Fix object unwrapping on VkGraphicsPipelineCreateInfo 2024-08-29 16:09:34 +01:00
baldurk 841a487d36 Add OS-abstracted semaphore primitive
* Uses POSIX sem on linux/android, dispatch semaphores on apple, Win32
  Semaphores on windows.
2024-08-29 12:21:41 +01:00
baldurk 62c86f647e Add a config option to print chunk timings in release 2024-08-29 11:14:54 +01:00
Jake Turner 2cd162144d DXBC Debug changes to support DXIL Debugging
Moved DXBCDebug::GatherPSDataForIntialValues() to DXDebug namespace and altered the input parameters.
Moved DXBCDebug::PSInputElement to DXDebug namespace
Added DXBCDebug::GetInterpolationModeForInputParams()
Added DXILDebug::GetInterpolationModeForInputParams()
2024-08-27 12:56:40 +01:00
Jake Turner 1d4cf8fb7b Rename DXBCDXILDebug shader debugging helpers to DXDebug 2024-08-27 11:37:55 +01:00
Arnaud Carré 97ea37d64f typo fix 2024-08-26 11:03:29 +01:00
Jasmine Hansen 0883514a8f Create edited shader object during resource replacement 2024-08-23 12:19:41 +01:00
baldurk a9d58f10ab Disable pointless gcc 14 warning. Closes #3417 2024-08-23 12:13:20 +01:00
Jake Turner 0e2decbae5 Add FunctionFamily and LLVMDbgOp enums to DXIL::Function
Saves having to do repeated string comparisons for function calls to identify if the instruction is a DXOp call or an LLVM Dbg call.
The LLVM Dbg calls are unique and the specific llvm dbg operation is stored in the DXIL::Function
The DXOp calls are not unique and the zero'th argument of the CALL Instruction is used to determine the DXOp opcode.
2024-08-22 12:56:31 +01:00
baldurk c64866ba08 Handle DXIL-declared local root signatures
* We attempt to handle associations in DXIL subobjects but this needs
  significantly more testing to understand how it's meant to work.
2024-08-20 14:49:48 +01:00
baldurk 72ffdc01bd Replace manual patching of PSV with decode/encode
* The DXIL program editor will now automatically decode and encode the PSV and
  RDAT chunks (if found) as part of its roundtrip
2024-08-20 14:49:48 +01:00
baldurk 20f5725bbd Add reading and writing of pipeline validation chunk 2024-08-20 14:49:48 +01:00
baldurk 946df28742 Wrap up string buffer and index arrays to be reusable with a tweak
* For some reason in RDAT the strings are deduplicated, but in PSV they are not.
  Similarly in RDAT the index array packing prefixes each array with its length
  but in PSV the index array is entirely loose and deduplication can happen
  effectively anywhere.
2024-08-20 14:49:47 +01:00
baldurk b82ee6ac14 Stub out PSV structures for external access
* We move some commonly used enums to more general spots for ease of use in the
  encoded data.
2024-08-20 14:49:47 +01:00
baldurk 8cb615e217 Fix assert when disassembling unorm or snorm typed resources 2024-08-20 14:49:47 +01:00
baldurk a1dc494fb5 Add decoding and encoding for RDAT
* Only tested so far on round-trip behaviour, not with modifications. By default
  we don't make any changes yet but the DXIL program editor may in future
  automatically decode and encode the RDAT so it can stay in sync if resources
  are added.
2024-08-20 14:49:47 +01:00
baldurk 7adff9faff Add stubbed structures for RDAT decoding/encoding
* We have parallel structures that are mostly the same but are 'flattened' with
  indices for lookups for arrays or strings
2024-08-19 16:15:14 +01:00
baldurk 304e636b4a Only try to fetch embedded implicit root signature from ShaderEntrys 2024-08-19 16:15:14 +01:00
Cam Mannett 647313ae14 Vulkan AS rebuild-on-replay: BDA tracking
In order to unify the input structs between host and device builds, the AS API uses addresses rather than VkBuffer handles, but there's no way of retrieving a handle from an address so we have to track all VkBuffer binds to map their addresses back to the owning handle. This is done is in TrackInputBuffer(..) and UntrackInputBuffer(..), the latter for when the resource is destroyed. A complexity here is that when doing the lookup, users are allowed to manipulate the BDA so we have to find the buffer the address lies in and return the offset too.
2024-08-14 11:09:19 +01:00
baldurk 808a14dede Handle SPIR-V GL shaders with no location on texture binds. Closes #3405
* Since GL doesn't have sets, use the fixedBindSetOrSpace to namespace bindings
  with locations (that need to be queried) from bindings without locations
  (which have a fixed bind). Prior to the descriptor refactor this was indiated
  with negative binds.
2024-08-12 12:42:23 +01:00
baldurk 9607410b94 Strip VK_EXT_hdr_metadata extension on replay
* This is a pure WSI extension
2024-08-12 12:26:48 +01:00
Jasmine Hansen 52a3792dd2 Add support for shader objects in vulkan pixel history
Add shader object helper to debug manager
Add shader objects to shader cache and vulkan pixel history callback
Add shader objects to occlusion, color and stencil, tests failed, per fragment, and discarded fragments callbacks
2024-08-12 10:53:29 +01:00
baldurk 88be65d1c6 Use correct qmake flag in archlinux workaround 2024-08-09 21:50:10 +01:00
baldurk a2872c83d1 Workaround broken qmake on Archlinux 2024-08-09 13:54:51 +01:00
baldurk 109a6a427f Allow executables to launch to be found via PATH. Closes #3403 2024-08-08 13:25:46 +01:00
Connor Abbott 2147b4db75 Fix build errors on GCC 14
Fix errors due to the new template-id-cdtor warning, e.g.:

renderdoc/renderdoc/driver/vulkan/vk_serialise.cpp:201:58: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
  201 |   OptionalResources<Serialiser<SerialiserMode::Writing>>(Serialiser<SerialiserMode::Writing> &ser)
      |
2024-08-08 10:57:56 +01:00
Jake Turner c1afe9e984 Last member in SPIRV structs use baseSize for array stride Closes #3392
Change matches comments in code but wasn't implemented.

Before this change struct A size would be larger than struct B (which is struct with an extra member)

struct Nested
{
  float a;
};

struct A
{
  Nested child[16];
};

struct B
{
  Nested child[16];
  float f;
};
2024-08-06 15:14:28 +01:00
baldurk 8b46a1a8fc Update from toolwindowmanager repository @ 106405739ef8b 2024-08-06 15:14:28 +01:00
Jake Turner 811ec2a5bd Do not crash in OpenCapture if m_RDC is NULL
The NULL case was being handled for setting the return code and then Error() was being called on a NULL m_RDC
2024-08-05 17:50:37 +01:00
baldurk 9ef756d626 Clear orphaned entries from value symtab when editing DXIL 2024-08-05 17:40:31 +01:00
baldurk 90832a18f0 Update from toolwindowmanager repository @ 117c15c1c67a2 2024-08-05 17:40:31 +01:00
Cam Mannett d78adf7e99 Fix Android env var collection
RD uses getprop to emulate geting env vars configured from the host, and it uses Process::LaunchProcess to do this that in turn uses fork/execve to launch getprop.  But execve doesn't use the env's shell lookup mechanism for exes - this resulted in the getprop call failing and the capture options using default values.

This fix is to switch to using execvpe.
2024-08-05 17:21:03 +01:00