Commit Graph

14520 Commits

Author SHA1 Message Date
baldurk 205ed0e6fa Remove old shader bindpoint mapping handling entirely 2024-04-10 18:58:52 +01:00
baldurk acc533ec60 Update Vulkan pipeline state viewer to use new descriptor access 2024-04-10 18:58:52 +01:00
baldurk 5d13456a65 Update D3D12 pipeline state viewer to use new descriptor access 2024-04-10 18:58:52 +01:00
baldurk 317c670fd5 Update GL pipeline state viewer to use new descriptor access 2024-04-10 18:58:52 +01:00
baldurk e08107ebe8 Update D3D11 pipeline state viewer to use new descriptor access 2024-04-10 18:58:52 +01:00
baldurk f4e3087177 Update common pipeline state viewer code to not use bindpoint mapping 2024-04-10 18:58:51 +01:00
baldurk 2c170df588 Fetch D3D12 dynamic feedback directly as descriptor accesses 2024-04-10 18:58:51 +01:00
baldurk 5e759b7fc9 Fetch vulkan dynamic feedback directly as descriptor accesses 2024-04-10 18:58:51 +01:00
baldurk f00ab9dee8 Store descriptor type directly in shader resources for shader reflection 2024-04-10 18:58:51 +01:00
baldurk 292bb596dc Add GL input attribute dynamic binding information to pipe state 2024-04-10 18:58:51 +01:00
baldurk 2bbe1a8cd9 Update shader viewer and debugging with new reporting for shader binds
* This shifts from reporting from the old style bindset/bind to the new system
  of only referencing by shader interface and index (independent of binding
  model).
* The vulkan shader debugger re-uses the replay interface to cache descriptor
  access and descriptor contents in a fashion friendly to interface-index
  lookup.
2024-04-10 18:58:51 +01:00
baldurk f718e72ac9 Update texture viewer to use new pipeline helpers 2024-04-10 18:58:51 +01:00
baldurk d8fd03d60f Update shader message viewer to use new pipeline helpers 2024-04-10 18:58:51 +01:00
baldurk af6abd79c0 Update buffer viewer to use new descriptor/binding interface 2024-04-10 18:58:51 +01:00
baldurk 2a41eb54dd Add new common pipeline state accessors for descriptor-based accesses
* These are temporarily given separate names, to allow them to exist in parallel
  with the existing helpers, but in future these will be renamed when the older
  helpers are removed.
2024-04-10 18:58:51 +01:00
baldurk bbbfb5f3d2 Add fixed bindpoint information to shader reflection data
* Previously this was provided by the ShaderBindpointMapping, but since we plan
  to remove that we add the information here. These will be purely for
  informational purposes and will not be used to look up bound resources etc.
  They exist for display only, or for API-specific interpretation if e.g. the
  bindpoint is known ahead of time it can be identified here without having to
  jump through hoops to get which descriptor a given bind accesses and get the
  register number for that descriptor.
* On OpenGL this information will not be present because bindings are mutable
  (even if they are declared in the shader). The only way to identify a
  particular binding by register will be with those hoops
2024-04-10 18:58:50 +01:00
baldurk d88aad8fc2 Add a query to determine logical identifiers for descriptors
* This is a consideration for any cases where binding numbers are relevant -
  primarily D3D11 and GL - where the offset into an arbitrary (and possibly
  fake) descriptor storage is not helpful but knowing the register binding
  definitely is.
* If someone wants to look at the raw descriptor contents without respect to a
  particular shader access they can use this query to determine a more useful
  'name' for any given descriptor. On D3D11 and GL this gives the register
  number, on Vulkan it gives the binding number (and array element). On D3D12 it
  just repeats the offset effectively.
2024-04-10 18:58:50 +01:00
baldurk b9787606ea Add reported descriptor access from vulkan and D3D12 bindless feedback 2024-04-10 16:31:17 +01:00
baldurk 1f803add1e Declare input attachments in shader reflection
* This avoids the need to communicate this information in the descriptor type.
  Since descriptors must match the shader in this area, it's easier to
  communicate this through shader reflection.
2024-04-10 16:22:42 +01:00
baldurk 13986a0da5 Handle immutable/static samplers on Vulkan and D3D12
* On vulkan immutable samplers mostly work as-is because they have a descriptor
  set space even if they may not be written dynamically. We just set a flag so
  the replay API is aware they're compile-time constant.
* On D3D12 we follow the path of root constants and other non-descriptor backed
  bindings, by creating virtual descriptor store in the root signature where the
  static samplers are created.
2024-04-10 16:14:29 +01:00
baldurk fa22c7c7fc Report vulkan dynamic offsets separately for manual application
* Baking these into descriptors when we get arbitrary 'GetDescriptor' queries
  independent of the bound descriptor sets is not possible - a descriptor set
  could be in theory bound twice to two places with different dynamic offsets.
* Instead we report these as part of the pipeline states and the abstraction &
  replay API consumer will need to manually apply them to get the true buffer
  offset.
* The offsets are indexed by descriptor storage byte offset for easier
  processing (the dynamic offset struct can be turned into a pair and used to
  initialise a dict)
2024-04-10 16:12:32 +01:00
baldurk d03c379f3d Add handling for root descriptors on D3D12
* Root descriptors don't have concrete backing storage so they don't quite fit
  the model, so instead we pretend their backing storage is in the pipeline as a
  'virtual' descriptor indexed by the root index.
2024-04-10 16:05:59 +01:00
baldurk 343a195b89 Add handling for 'virtual' descriptors on Vulkan
* Things hat don't neatly fit into our descriptor-based model like push
  constants, specialisation constants, and inline UBOs inside descriptor sets.
* In these cases (except for the last case) we don't have an explicit
  descriptor, so we create a virtual one that lives in the corresponding object
  - pipeline, command buffer, etc and some virtual storage to reference.
2024-04-10 16:03:14 +01:00
baldurk 55f0cd0561 Generate baked per-pipeline static descriptor access on D3D12 2024-04-10 16:00:34 +01:00
baldurk 50091dcffc Generate baked per-pipeline static descriptor access on Vulkan 2024-04-10 15:57:48 +01:00
baldurk 58c3dc52a7 Add reporting of GL texture completeness and conflicts for descriptors 2024-04-10 15:51:10 +01:00
baldurk a3c165faad Generate GL 'descriptor access' at runtime based on mapping
* This encodes the current potentially mutable uniform bindings into the
  descriptor access.
2024-04-10 15:43:41 +01:00
baldurk c33807e95e Implement queries for D3D11 descriptor access
* Since D3D11 is entirely non-bindless we can precalculate the descriptor access
  for a shader up-front from its reflection and combine at query time from the
  currently bound shaders. This effectively replaces the old bindpoint mapping.
2024-04-10 15:42:35 +01:00
baldurk 227842a295 Add a structure and query for reporting descriptor accesses 2024-04-10 15:33:36 +01:00
baldurk c1d07f6bc3 Implement Get*Descriptor for virtual descriptor storage in D3D11 & GL 2024-04-10 15:24:03 +01:00
baldurk ff821b25c8 Create fake descriptor storage objects for GL and D3D11 2024-04-10 15:17:38 +01:00
baldurk 28e86de0f9 Implement Vulkan descriptor fetching contents directly from sets 2024-04-10 15:11:01 +01:00
baldurk 9d8008f9b3 Set up some descriptor data to easily interpret contents in isolation
* For descriptors with immutable samplers the existing code already refuses to
  update/change them, but the descriptor won't contain the sampler unless it
  goes through init contents at which point we slot it in for easier validity
  checking. Instead we can set the immutable samplers at creation time when we
  know them. We can also set the descriptor type here as mutable descriptors
  cannot use immutable samplers.
* Similarly for inline uniform blocks if they are variable sized we can set
  their size here as well as the variable size is known at creation time.
* With these changes the contents of a descriptor can be processed entirely from
  the DescriptorSetSlot with two exceptions:
  - An immutable sampler flag, the source of the sampler is unknown
  - Dynamic offsets on descriptors, which vary based on where the descriptor set
    is bound (and in theory one descriptor set could be bound twice with two
    different offsets)
2024-04-10 15:08:51 +01:00
baldurk 7e359ee4ab Implement D3D12 descriptor fetching contents directly from heaps 2024-04-10 15:07:32 +01:00
baldurk b94e6ff90c Add a stubbed out query for pulling descriptor contents out of a store 2024-04-10 15:01:26 +01:00
baldurk 7ef216ad35 Add common descriptor type for all APIs
* Separated into normal descriptors and sampler descriptors, since they are
  almost equal in size so there's no need to inflate the descriptor size for
  non-sampler descriptors which are much rarer.
2024-04-10 14:55:32 +01:00
baldurk 0e9a43e3d0 Query number of supported MSAA sample counts properly in GL_Texture_Zoo 2024-04-10 14:48:44 +01:00
baldurk cc52e31657 Add overload to search array with a different type without casting
* Provided a compatible operator== overload exists, this can still be used to
  search the array.
2024-04-10 14:47:52 +01:00
baldurk 7fdff69935 Fully reset pipeline view objects when unbound 2024-04-10 14:40:57 +01:00
baldurk 1fb29ce97d Explicitly build with C++14 everywhere
* This doesn't change our minimum specs as we already required GCC 5, clang 3.4,
  which fully support C++14. Interestingly only VS2015 is the odd one out but we
  don't rely on any features from C++14 that it doesn't support.
2024-04-10 14:38:05 +01:00
Jake Turner 922ef9814f Stop crash in BufferViewer if buffer size is less than fixed length
i.e. a zero sized buffer
2024-04-10 10:29:06 +01:00
Jake Turner f3c9074a73 Fix out of bounds read of "&array[0]" (use array.data()) 2024-04-10 08:20:56 +01:00
Jake Turner 3a8fecf08e Prevent Shader Editor tooltip showing multiple "(F5)" 2024-04-10 08:20:56 +01:00
William Pearson ec74c13465 Fix typo in AndroidAPKInstallFailed message
This message can be seen if the USB cable connecting the device is
removed while the `adb install` command is running. (I ran into this
by accident due to a low-quality cable.)

The previous message was this:

> Failed to install Android remote server for unknown reasons: Couldn't install APK(s). stderr: adb.exe: device '00000a740f4e6d93' not found
> .
>
> lease check that your device is connected and accessible to adb, and that installing APKs over USB is allowed.

This does also include a newline before a period, which looks a bit
strange but I don't see a quick fix for that while keeping stderr,
and the stderr output is fairly useful.
2024-04-09 09:45:14 +01:00
baldurk 0795c75246 Recursively delete all command buffer nodes to avoid leak 2024-04-08 11:47:25 +01:00
James Sumihiro fcb8730132 Added support for VK_EXT_nested_command_buffer
Serialisation functions were updated for new structs and enum values. CaptureQueueSubmit was updated to recurse nested command buffer records so that command buffers and their resources are referenced in the capture. The logic for rebasing secondary command buffer events was updated to support nesting. The PartialReplayData struct was updated so all partial submissions can be tracked during active replay.
2024-04-08 11:30:06 +01:00
Cam Mannett 26ce7ec7bc Vulkan acceleration structure manager
Manages the capturing, serialising, and replay of acceleration structures for Vulkan.  It works in a similar way to how device memory is handled:
* A temporary host-accessible buffer is created for each AS
* The AS is serialised (in the Vulkan AS sense of the word) into it
* The buffer handle is stored in the initial contents and downloaded when
  appropriate
* Replay is handled similarly but in reverse
* Workaround added for broken Mali AS serialising
Note this is missing the descriptor and SPIR-V handling, that work will follow in a later PR.

The serialiser version has been bumped for backwards compatibility with 'RenderDoc for Arm GPUs 2024.0'.
2024-04-08 11:14:37 +01:00
kb1000 c16b2f34cd Add pythoncapi-compat third party library acknowledgement 2024-04-08 10:57:28 +01:00
kb1000 729fcfe187 Update pythoncapi_compat.h 2024-04-08 10:57:28 +01:00
kb1000 bb7ec408cb Use pythoncapi-compat to simplify Python C API backwards compatibility 2024-04-08 10:57:28 +01:00