Commit Graph

180 Commits

Author SHA1 Message Date
baldurk 95e6a4a971 Respect font scale for fixed-width fonts 2021-04-12 13:04:02 +01:00
baldurk dce2c62bde Fix typo in shader viewer menu item. Closes #2201 2021-03-08 16:45:05 +00:00
baldurk 29c5965599 Update some missing entries and comments from custom shader snippets 2021-01-27 12:49:36 +00:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk 7ff7e0a71d Replace fixed C arrays with wrapper class in public interface
* These map more naturally to python tuples and are easier to wrap in and out.
* We also tidy up the FloatVecVal etc and standardise the members of
  ShaderValue.
2020-12-09 18:16:08 +00:00
baldurk 6b8ce92d88 Clean up docstrings in python interfaces to be strictly typed/formatted
* Also added a script that can run as part of CI to verify that the docstring
  matches, by generating a regex from the docstring documented parameter types
  and return type and making sure we find a match within the C headers. This
  ensures all parameters are documented with the right types, no extra
  parameters are documented, and the return type is correct.
* The script also checks proper scoping so that if qrenderdoc docstrings
  mention a renderdoc type, they need to scope it properly.
2020-12-07 17:44:51 +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 9610919c16 Fix copy-paste of rich resource text
* We need to cache to the QString text on demand, which requires a context
  potentially sooner than paint/etc time.
2020-12-02 17:44:46 +00:00
baldurk 806187f613 Save and load edited shaders as capture modifications
* When a shader edit is loaded with a capture, it's loaded as "pending" and not
  immediately applied.
2020-10-21 14:14:20 +01:00
baldurk 2481957f1a When shader debugging is cancelled, still display partial debug trace 2020-09-21 14:39:20 +01:00
baldurk 56f82f6bf1 Optimise UI for large descriptor arrays with few dynamically used binds
* We tune the pipeline state view and texture viewer to only iterate over a
  small list of dynamically used binds in the (vastly more common) case where
  unused binds are not being shown.
2020-09-03 18:09:47 +01: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
Steve Karolewics 99bfc41caa Add bounds checks for resources in shader viewer UI 2020-06-12 13:39:50 +01:00
baldurk 60b710f24a Fix display of matrices inside source variable-mapped structures 2020-06-05 12:44:38 +01:00
baldurk 759fad10e3 Remove sleep accidentally left in 2020-05-19 16:35:10 +01:00
baldurk a81994071f Wait for shader viewer background debugging, add cancel button
* Until we properly support background debugging we need to wait for it to
  complete, otherwise the user could close the window and we'd crash.
2020-05-15 20:31:42 +01:00
Steve Karolewics ef58d7e1f8 Extend info in accessed resources panel in the shader viewer 2020-05-08 20:43:04 +01:00
baldurk 4c195dd93c Fix source variables not being marked as modified 2020-05-05 18:17:43 +01:00
baldurk e2fce8cad1 Fix crash if accessed resource is unbound 2020-04-30 18:15:29 +01:00
baldurk 2865fe101d Deduplicate resource accesses by binding not by name
* For D3D this should be equivalent since name == bindpoint, but for SPIR-V this
  prevents the same binding being loaded into multiple SSA variables from being
  added every time.
2020-04-29 18:48:51 +01:00
baldurk fe882fe872 Default to debug variables panel if there's no high-level debug info 2020-04-29 18:48:50 +01:00
baldurk 1da60805e0 Allow source variable mappings to point to the root of a complex type
* For vulkan debugging where high-level variables are not scattered amongst
  vectors, there's no point in having the whole tree expanded for source mapping
  struct-to-struct or array-to-array.
2020-04-29 18:48:50 +01:00
Steve Karolewics 08d1189d99 Give ShaderViewer its own copy of bindpoint mappings
Previously this data was a reference to the current pipeline state, so
when the selected event changed, the ShaderViewer's bindpoint mappings
would be inaccurate.
2020-04-27 18:16:46 +01:00
Steve Karolewics 2c4f2a57a8 Add resource tracking to DXBC shader debugging
When a resource is accessed, it is now tracked by the debug step. The
shader viewer has a new panel to display resources accessed up to the
current step, with context menus to go to previous/next access of a
specific resource.
2020-04-27 18:16:46 +01:00
baldurk 267798b240 Add boolean vartype 2020-04-24 20:14:48 +01:00
baldurk 97665b2c30 Display resources in shader viewer tooltips properly 2020-04-23 19:14:09 +01:00
baldurk aae3a75f6e Add newly added variables to start of variables list
* But all variables added in a single step still remain in the order they're
  reported in as changes.
2020-04-23 19:14:08 +01:00
baldurk 1ec3320e99 Don't bounds check instruction numbers against disassembly line count 2020-04-17 16:52:35 +01:00
baldurk 8e082ae109 Preserve order when combining structures in shader viewer 2020-04-14 18:25:18 +01:00
baldurk 97c7dd681f Add global samplers array to shader debug trace 2020-04-09 18:36:12 +01:00
baldurk 47dedaf8c5 Support shader variables that refer to resource bindings 2020-04-09 18:36:12 +01:00
baldurk 59c3a2fbd9 Implement matrix multiplication with matrix/vector/scalar 2020-04-08 18:39:02 +01:00
baldurk 9ba81634b4 Improve the title of shader edit windows 2020-04-03 15:19:28 +01:00
baldurk 27f2a4b7f9 Don't modify states/variables list on replay thread
* Otherwise this can race with the UI thread if it's executing a shortcut.
2020-03-30 21:47:39 +01:00
baldurk 04f90e055d Protect against empty traces in shader viewer 2020-03-20 16:16:51 +00:00
baldurk 3bb57bfed7 Support input source vars referencing complex struct type debug vars 2020-03-18 17:34:59 +00:00
Steve Karolewics 67447b7b7e Improve handling of resource arrays for D3D12
When getting read only resources from the pipe state, stitch back up
according to the bindpoint mappings. When displaying resources in UI,
don't traverse unbounded arrays. Fix resource swizzle on load/sample/
gather instructions, which happens on fetch result, not on the source
operand. Added more tests for unbounded arrays and different ways to
index into arrays.
2020-03-16 20:01:30 +00:00
baldurk 936e6372cb Remove use of 3rdparty/ prefix from includes
* We instead always have 3rdparty/ in the relevant include search paths and rely
  on that. Each library still has its own unique base dir within 3rdparty to
  clarify where the include is coming from.
2020-03-11 18:00:53 +00:00
baldurk e22ed4b877 Fix handling of component swizzle display in cbuffer. Closes #1754 2020-03-04 19:12:24 +00:00
baldurk 175f71beb1 Always combine structures even with only one child
* This means that foo.bar.baz will still have a hierarchy created even if each
  level only has one child.
2020-03-02 17:37:23 +00:00
baldurk a2b437b903 Change Find/Replace dialog to have Find Next/Find Previous buttons
* Enter and shift-enter in the find text go forwarwd and backwards respectively.
* This replaces the previous system of selecting a direction explicitly and only
  ever going in that direction when finding.
2020-02-25 18:19:52 +00:00
baldurk fd14205d40 Don't refresh current event every ContinueDebug 2020-02-24 18:10:56 +00:00
baldurk de7f9d8e1c Remove hasSourceMapping from ShaderDebugTrace
* We expect to always have source mapping, from reflection data if nothing else.
2020-02-20 19:07:29 +00:00
baldurk 08e9d9b594 Fix typo - don't apply debug variables expansion to source vars 2020-02-20 19:07:29 +00:00
baldurk 3baedb966e Don't add a value representation for matrix/struct/array debug variables 2020-02-20 19:07:29 +00:00
baldurk b0e4cd6235 Handle matrix registers in shader viewer 2020-02-20 19:07:28 +00:00
baldurk d58691bc16 Standardise debug and source variable naming conventions
* We standardise on definitions: source variable names contain the full path,
  and identify debug variable by full path. Debug variable members only contain
  the child element - so foo doesn't contain members foo[0] or foo.bar, it
  contains [0] or bar. Path walking happens when mapping source variable to
  debug variable.
* This works just as well for DXBC but works much better for SPIR-V where debug
  variables can be more complex.
2020-02-20 19:07:28 +00:00
baldurk f2c401a255 Check that all states are present before allowing any stepping 2020-02-18 19:18:51 +00:00
baldurk 69a82202e5 Remove redundant/tautological checks 2020-02-13 11:01:45 +00:00
Steve Karolewics 671add4035 Fix shader debugging and pipeline viewer with constant buffer arrays
With SM5.1 and D3D12, constant buffer arrays can be declared which
are treated as an array of resources on the shader side, and a simple
collection of descriptors on the D3D12 side. DXBCDebug::GlobalState
handles the bridge between these by storing each array resource as a
nested ShaderVariable struct. Accessing the data for instructions
traverses the structure similarly. The shader viewer handles nested
resources and displays them in the appropriate tree view. In the
pipeline viewer, descriptors for CB arrays now indicate the array
index and correctly handle buffer offsets for viewing.
2020-02-11 17:10:57 +00:00