Commit Graph

16064 Commits

Author SHA1 Message Date
baldurk f86c36d4f6 Forced reference images/samplers/views when using descriptor buffers 2025-07-30 22:10:24 +01:00
baldurk 5b5e4f9bbb Insert serialisation of opaque capture data for resources as needed 2025-07-30 22:10:24 +01:00
baldurk 6e1bacf1f2 If descriptor buffers are enabled estimate descriptor formats
* We do this independently for capture/replay, there is no need to serialise the
  results as any bit-differences in descriptors will cause a failure
2025-07-30 22:10:24 +01:00
baldurk f75a39d171 Implement descriptor buffer binding and track & restore its state 2025-07-30 22:10:24 +01:00
baldurk dacb5aab79 Add fast descriptor lookup for known descriptor formats
* The idea here is to directly extract a pointer and/or size and do few lookups
  (hopefully only one) to verify that we have recognised the descriptor. We
  still have the trie lookup as backup.
2025-07-30 22:10:24 +01:00
baldurk 76119c5811 Record information needed during replay for fast descriptor lookups
* For palettised image/sampler descriptors this includes initialising the
  palette with the opaque data, and for regular image descriptors this means
  recording the address range of images. Buffers we already have their addresses
  which is all we need.
2025-07-30 22:10:24 +01:00
baldurk c9dc74c572 Use GPU address range tracker during replay for BDA buffers 2025-07-30 22:10:24 +01:00
baldurk 15e63e9b8e If available enable the ImageLayoutIgnored feature
* This should really have been considered a property, it's unlikely drivers do
  anything different, but we want to be able to count on it being present.
2025-07-30 22:10:24 +01:00
baldurk 04474a885a Record unique texel buffer formats seen during replay 2025-07-30 22:10:24 +01:00
baldurk 03f0fbe6fa Record descriptor byte patterns in trie with DescriptorSetSlot value 2025-07-30 22:10:23 +01:00
baldurk 2eb028f31a Descriptor buffers must force on BDA for all memory
* This is required for any images that will be bound to the memory
2025-07-30 22:10:23 +01:00
baldurk efd60e5751 Serialise unique descriptor fetches on a per-resource basis
* ASs and samplers can only have one descriptor ever - we automatically fetch
  this at creation time when descriptor buffers are enabled. We also fetch all
  possible NULL descriptors at device creation and do not re-serialise them
  afterwards.
* Image views may have either 1 descriptor (if layouts are ignored) or N (one
  per layout). Buffers have N per offset/size and optionally format. These are
  tracked for uniqueness in the corresponding resource record to ensure we don't
  serialise infinite descriptors over time.
* For combined image/samplers since they are in a known format we serialise
  these as-if they are image view descriptors only (with some extra data that we
  ignore). The whole descriptor must still replay bitwise identical but we will
  only use the image view part of it.
2025-07-30 22:10:23 +01:00
baldurk 4ebfded137 Track ASs by address when descriptor buffers are enabled
* They are written into descriptors via address not object with descriptor
  buffer
2025-07-30 22:10:23 +01:00
baldurk ff11a2b0e1 Add CAPTURE_REPLAY_BIT flags globally when descriptor buffers are used
* This applies to all ASs, images, image views, buffers and samplers. Buffer
  views are not used with this extension. We enable this globally even if there
  are resources which wouldn't be possible to put in a descriptor (e.g. transfer
  only) or if they are internal allocations. The ordering rules are poorly
  written - as the letter of the spec goes it would be impossible to ever omit
  this flag during capture since we can't put all capture/replay creates before
  all non-capture/replay creates. On replay in theory we could, but we also
  don't know how well drivers will implement these rules anyway.
2025-07-30 22:10:23 +01:00
baldurk a1ee01e89c Force reported descriptor buffer sizes to be robust sizes 2025-07-30 22:10:23 +01:00
baldurk ceb062b658 Add a DescriptorType to GetDescriptors query
* This will be optional in many cases but for some situations might be required
  when type information is not implicitly available in the descriptor store.
  Generally it should always be available unless the descriptor store is being
  viewed 'blank' purely from its contents with no other context.
2025-07-30 22:10:23 +01:00
baldurk f896f8a2e2 Enable robust buffer access during capture
* We already enable this during replay, for descriptor buffer we will have to
  have it match but in general it's a good idea to match environments between
  capture and replay.
2025-07-30 22:10:23 +01:00
baldurk 9255c00c7a Check descriptor buffer features and enable capture/replay feature 2025-07-30 22:10:23 +01:00
baldurk 8529250746 Only allow descriptor buffer if cap/replay bit & descriptor sizes allow 2025-07-30 22:10:23 +01:00
baldurk 9545e6f27b Add specific annotation for GPU address serialised values 2025-07-30 22:10:22 +01:00
baldurk 0f96fd3f0c Add next chain handling and structure unwrapping for descriptor buffers 2025-07-30 22:10:22 +01:00
baldurk 87927b4c7a Add stubbed functions and hooks for EXT_descriptor_buffer 2025-07-30 22:10:22 +01:00
Kanglai Qian 78862bfce7 avoid erase map's end 2025-07-30 18:21:40 +09:00
baldurk 06eaf5a33a Fetch buffer usage flags correctly from extended flags 2025-07-29 21:43:31 +01:00
baldurk a7378e525e Merge descriptor ranges correctly in GetDescriptors calls 2025-07-29 21:43:31 +01:00
baldurk 722df90e7b Don't fill AS descriptors if AS extension is not available in demo 2025-07-29 21:43:31 +01:00
baldurk e7f10d3a84 Detect differences in opaque capture address and fail capture load
* This should not happen, the vulkan spec guarantees that this function must
  return the same value passed in if there was one, and this can help detect BDA
  addresses moving.
2025-07-29 21:43:31 +01:00
baldurk 25adde711a Enforce extra alignment on AS buffers in demo 2025-07-29 16:44:08 +01:00
baldurk e11f3036d8 Destroy query pools on shutdown 2025-07-29 16:43:09 +01:00
baldurk d1ce4ac412 Ignore VUID-vkAcquireNextImageKHR-semaphore-01779 2025-07-29 16:43:05 +01:00
baldurk 259225cacb Apply workaround for presumed windows bug with BDA capture/replay
* This replaces the previous workaround disabling BDA capture/replay on
  dedicated image memory, as that is not feasible with future functionality and
  appears not to be the source of the bug seen before.
* Although this is believed to be a windows bug, it only manifests on NV so is
  treated as an NV bug for now. A future NV driver should contain a workaround
  for this so it can be disabled later.
2025-07-29 15:32:33 +01:00
baldurk 3be544c51d Prevent infinite recursion when processing includes for shader edits 2025-07-29 13:05:07 +01:00
baldurk c1138e20c5 Handle debugging PS with unwritten inputs
* If a VS-PS declares a struct but there is an element which is declared but
  never written in the VS (and never read in the PS) then we can't read from it
  and must skip that element.
2025-07-29 13:04:43 +01:00
Cam Mannett 15a19eb507 Serialise GLSL shader processing
During Android >=15 app start android::uirenderer (i.e. the renderer for the APK's 'window') creates a VkInstance and VkDevice before the app does but after our layer has initialised. This is fine in principle because RD doesn't support multi-device capturing so the latter just replaces the former - unfortunately though the built-in shader construction is already underway at this point across the multiple threads.  glslang's shader preprocessing is not threadsafe causing intermittent aborts and segfaults.

I haven't seen this on any app other than the RD demo app, presumably because 'real' apps take much longer to start up effectively serialising the shader processing.
2025-07-28 14:52:13 +01:00
Lizzie 8649146147 fix for solaris 2025-07-23 09:00:35 +01:00
Jake Turner d3a140d484 DXIL Debug data handling for inherited struct/class 2025-07-21 18:23:37 +01:00
Jake Turner 4ac2861e2b DXIL Shader Debug Data test for struct inheritance
struct TestGrand
{
  int3 i3;
  int2 i2;
};

struct TestParent : TestGrand
{
  int4 i4;
};

struct TestChild : TestParent
{
  int i;
};
2025-07-21 18:23:37 +01:00
Jake Turner a120fc0871 Add DXIL callstack generation handling for DIBase::Namespace 2025-07-21 14:43:46 +01:00
Jake Turner fa1a7b35cd Defensive coding for handling unpexecteded DXIL debug data 2025-07-21 14:43:20 +01:00
Jake Turner 08696443a0 Added workgroup performance tests and basic D3D11 Workgroup test
Added D3D11_Workgroup_Zoo, D3D12 Workgroup Zoo, Vk Workgroup Zoo performance tests

Performance tests primarily for performance testing workgroup debugging speed

Changed workgroup and subgroup result variable from "data" -> "testResult" to help to reduce conflicts
2025-07-21 09:16:56 +01:00
Andrew Marshall c612fdeb29 remove superfluous changed for macos build 2025-07-18 16:20:56 +01:00
Andrew Marshall b7612d8c9c cmake fixes for MacOS SDK 15.5 build (AppleClang 17) 2025-07-18 16:20:56 +01:00
baldurk 01115b3126 Detect cases where vectors are misaligned only in arrays. Closes #3644
* Scalar layout is required for vectors to straddle 16-byte boundaries but this
  may not be detected if they are naturally aligned within an otherwise mis-
  aligned struct.
2025-07-15 11:28:15 +01:00
baldurk 44e2fbfa2c Fix errors in pedantic C mode. Closes #3645 2025-07-14 11:22:14 +01:00
Jake Turner 2dcecf689b Set ThreadName for JobSystem worker threads to "JobWorker XX" 2025-07-13 09:26:33 +01:00
baldurk 98c2e94385 Switch to python script for CI VS install that might magically work
* Also for diagnostic purposes, print whether the installer succeeded
2025-07-11 11:06:12 +01:00
baldurk 279379c3be Fix potential trample in trie re-using leaf 2025-07-10 17:52:30 +01:00
baldurk 095556663d Try to improve linux pretty printers as much as possible
* These are not as good as natvis but better than nothing... maybe
2025-07-10 17:52:27 +01:00
baldurk b5d3cf07a3 Expand test to include array-indexing ASs as well as NULL AS 2025-07-10 17:52:23 +01:00
baldurk 378474d79c Disable bounds testing on inline UBO in descriptor
* Inline UBOs do not have bounds checking/robust access
2025-07-10 17:52:23 +01:00