Commit Graph
171 Commits
Author SHA1 Message Date
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 227842a295 Add a structure and query for reporting descriptor accesses 2024-04-10 15:33:36 +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
Jake Turner 7934d1d16e Change DebugPixel() to take a DebugShaderInputs struct
DebugShaderInputs struct contains existing the parameters:

sample
primitive

and a new parameter

view

Default constructor for DebugShaderInputs sets the parameters to NoPreference (~0U).
2024-03-13 07:58:48 +00:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
Jake Turner 788a0ca98f Zero initialize read_dds_data before loading DDS file 2023-08-25 10:20:28 +01:00
baldurk cd897063e3 Make error message more explicit when proxy texture fails to create 2023-08-14 16:37:04 +01:00
baldurk a34f890604 Disallow EXR files that are too large 2023-06-22 13:09:25 +01:00
baldurk 0f851df6c2 Batch prepare and allow limited buffering for vulkan initial states
* We add a capture option that defines a soft limit we aim to keep under for
  memory overhead during capture, excess initial states after that will be
  stored temporarily on disk.
2023-06-02 18:53:45 +01:00
baldurk d47e79ae07 Update copyright years to 2023 2023-02-01 12:23:32 +00:00
baldurk 4103f6a545 Properly zero initialise DDS return structure 2022-04-28 11:39:11 +01:00
baldurk 8aa0390948 Add string messages to returned result codes to display to user
* Most of the main entry points that can fail with relevant reasons now has a
  way of specifying a message to return with it. This message can be displayed
  to the user to give more information or context about an error.
2022-04-26 16:21:54 +01:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 3ac4bd0ebd Refactor custom shaders to abstract binding differences. Closes #2458
* Newly written shaders and any updated shaders can now use pre-defined macros
  to abstract away binding differences between APIs, so custom shaders will be
  more portable in particular shaders written in HLSL for D3D or GLSL on OpenGL
  won't break on vulkan because they refer to incorrect binds.
2022-01-31 19:14:08 +00:00
Mikkel GjoelandBaldur Karlsson 90cad57410 ApplyCustomShader accepts TextureDisplay instead of extracted data 2021-11-01 11:49:05 +00:00
baldurk c24dd2e7aa Use shader stage to properly disambiguate entry points on vulkan
* It's possible to have two entry points in a SPIR-V module both named "main" as
  long as they have different stages.
2021-10-04 17:03:27 +01:00
baldurk 1b42dcc05f Fix crash returning serialiser's structured file to dummy driver
* If we hit a fatal error during initialisation, the structured file pointer
  still points at the temporary serialiser's structured file. It's not until we
  finish loading that we swap it into the driver-stored file that we can safely
  return and detach ownership of.
2021-09-17 14:29:05 +01:00
baldurk 620e75c2a1 Add a system for backends to handle device lost/OOM errors and report it
* The UI will become non-functional and the backend will be replaced with a do-
  nothing one that keeps things alive without needing error bulletproofing
  everywhere in the real backend.
2021-08-18 20:12:07 +01:00
baldurk 45a8a63474 Dynamically allocate shaders and structured files to allow detaching
* These are the only handles returned up by reference from the replay driver,
  dynamically allocating them means that we can steal/move the ownership of
  these and keep them valid even after the replay driver is destroyed.
* Note - ShaderDebugTrace is also returned by reference but it is already
  dynamically allocated like this.
2021-08-18 20:12:06 +01:00
baldurk c319ac0234 Store API pipeline states in the replay controller
* Instead of storing the API pipeline states in the replay driver and returning
  pointers, we store them in the replay controller and write into it from the
  replay driver.
* This will allow us to remove the replay driver and still keep any previously
  obtained references/pointers to the pipeline state valid.
2021-08-18 20:12:06 +01:00
baldurk d0accc409b Rename 'name' member of ActionDescription to 'customName'
* This is a deliberate break of compatibility since the field is now often
  empty, for non-markers. This means code will get a more explicit error when
  the name is being referenced, so it can be updated to fetch the name it needs
  as needed.
2021-07-01 15:15:05 +01:00
baldurk 7149302680 Rename 'draw' or 'drawcall' to action
* There's not a good accepted terminology for this kind of event, and for
  historical reasons 'drawcall' has been the accepted term, even though
  that can be quite confusing when a dispatch or a copy is a 'drawcall'.
* This is particularly highlighted by the event browser filters where
  $draw() includes draws and dispatches, but $dispatch() only includes
  dispatches, it's hard to intuitively understand why $draw() matches all
  of these calls.
* As a result we've defined the term 'action' to cover these types of
  events in the same way that we defined 'event' in the first place to
  mean a single atomic API call.
2021-07-01 15:15:05 +01:00
baldurk d8d6557feb Add support for file includes from custom shaders. Closes #2275 2021-05-17 13:47:58 +01:00
baldurk a1e436a8e0 Add event and structured chunk for image viewer 2021-02-24 13:52:08 +00:00
baldurk d906e23f32 Store original texture details in image viewer, rather than patched
* If we need to patch the details we use that for proxy texture upload, but we
  still want to return the original details to the replay.
2021-02-24 13:52:07 +00:00
baldurk 11268b358a Remap block-compressed 3D textures to 2D arrays on GL. Closes #2186 2021-02-22 12:38:43 +00:00
baldurk c1c36f06ba Handle failed allocation in EXR image viewing path 2021-01-18 13:23:22 +00:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk 3aaccc4fda Use rdcfixedarray in parameters for functions instead of C arrays
* This maps better to tuples in python
2020-12-15 22:52:38 +00:00
baldurk e5f4ca7bb8 Remove use of const char * in public API and OS specific where possible
* This prevents unnecessary conversions back and forth between rdcstr and const
  char * when going through interfaces. In the OS specific layer this is rarely
  an issue because most of the implementations don't convert to rdcstr, but it
  is convenient to be able to pass in an rdcstr directly. The few cases where
  there's an unecessary construction of an rdcstr is acceptable.
* A couple of places in the public API need to return a string from a global
  function, so can't return an rdcstr due to C ABI, so they still return a const
  char *.
* Similarly const char * is kept for logging, to avoid a dependency on rdcstr
  and because that's one place where unnecessary conversions/constructions may
  be impactful.
2020-12-07 17:44:50 +00:00
baldurk 03b7229bad Support choosing multiview viewport in vertex debugging on vulkan 2020-10-28 13:34:08 +00:00
baldurk 83f7a26ee9 Query which shader disassembly formats require a pipeline
* This allows us to be a bit more friendly in the UI when we don't have a
  particular pipeline associated with a shader.
2020-09-01 14:03:59 +01:00
baldurk ee17cfee65 Use a checkerboard instead of a fixed colour for unbound thumbnails 2020-07-15 17:27:06 +01:00
baldurk abb959e1fd Handle array textures and multiview properly in overlays. Closes #1895 2020-05-27 22:38:23 +01:00
baldurk 45d15596de Make glGetTexImage blit fallback support more robust. Closes #1907 2020-05-25 16:27:53 +01:00
baldurk cf039acadc When possible with image viewer, manually unpack unsupported formats
* This is similar to the remapping the replay proxy does, and should support
  most non-compressed formats.
2020-05-18 13:21:55 +01:00
baldurk 5a0134ed4b Free shader debugger in replay driver so it's proxied correctly 2020-05-15 19:03:27 +01:00
baldurk 1cdb617cf9 Make sure to rewind image file when checking header 2020-04-01 14:11:42 +01:00
ArvastraandBaldur Karlsson d7af989746 Tidying up. 2020-03-19 17:16:01 +00:00
ArvastraandBaldur Karlsson 482114f6f4 Display Thumbnails for dds files. 2020-03-19 17:16:01 +00:00
baldurk 954e29df9e Fix handling of overlays when rendering to mips
* Also removes some unnecessary variations in behaviour between APIs
2020-03-12 15:42:54 +00:00
baldurk 310011999f Add bounds checking for DDS header values 2020-03-12 11:07:58 +00:00
baldurk c23825292d Remove redundant instOffset/vertOffset parameters from DebugVertex() 2020-02-20 19:07:29 +00:00
baldurk 4241e0ec55 Batch up calls to GetBuffers/Textures to be more replay proxy friendly 2020-02-14 19:31:59 +00:00
baldurk 661ee35f30 Refactor ShaderDebugTrace to not return a single list of complete states
* The ShaderDebugTrace now only sets up the initial state of an opaque
  ShaderDebugger handle.
* This handle can then be passed to a new function - ContinueDebug - to
  iteratively return N more states. The number of states is implementation
  defined and may be a fixed number or it may run for a fixed time.
* The states themselves no longer contain a complete snapshot of all variables,
  but instead only the changed variables for that iteration. The changes are
  stored as before and after value to make it easier to step forwards and
  backwards (only the ShaderDebugState is needed to move forward or backwards,
  you don't have to search back for the last set value of a variable to 'undo' a
  change).
2020-02-06 17:58:42 +00:00
baldurk 7dd116abd4 Remove redundant/tautological comparisons identified by PVS Studio 2020-01-21 18:28:56 +00:00
baldurk c98500e657 Fix pixel picking from custom shader output in image viewer. Refs #1688 2020-01-17 19:53:39 +00:00
baldurk d4e723bfd8 Fix bugs identified by using PVS Studio
* A few copy-paste errors, some tautological checks indicating errors, missing
  return value checks.
2020-01-17 19:53:38 +00:00
baldurk e347912479 Don't set TextureCategory::SwapBuffer on image viewer texture
* This prevents toggling linear/gamma display because swap buffers are always
  interpreted as gamma.
2020-01-17 19:53:38 +00:00