1893 Commits

Author SHA1 Message Date
baldurk f23d86fb6b Use shader encoding when saving shaders to disk 2020-03-06 17:56:27 +00:00
baldurk 14dc2a57f6 Fix refcounting on python traceback object 2020-03-06 17:56:27 +00:00
baldurk a18716e63d Fix crash if no drawcall is selected when exporting pipeline state 2020-03-05 11:15:48 +00:00
baldurk 6579dfc666 Add protection against target control connection dropping immediately 2020-03-05 10:39:36 +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 ce58f991f0 Apple compile fix 2020-02-25 19:06:58 +00:00
baldurk 4703012a87 Add pagination for very large range buffer viewers 2020-02-25 18:19:52 +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 8102a784bf Update ToolWindowManager to eb4eb70f1 2020-02-25 18:19:52 +00:00
baldurk 66931b146a Remove extra margin on replay settings tab 2020-02-24 18:10:56 +00:00
baldurk fd14205d40 Don't refresh current event every ContinueDebug 2020-02-24 18:10:56 +00:00
baldurk a81d5c78b2 Update ToolWindowManager to 4c47912 2020-02-24 18:10:55 +00:00
baldurk c05dd34962 Switch back to setPointSizeF for scaling fonts 2020-02-24 18:10:55 +00:00
baldurk c23825292d Remove redundant instOffset/vertOffset parameters from DebugVertex() 2020-02-20 19:07:29 +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 1e8c24fa56 Remove debug print 2020-02-19 11:33:51 +00:00
baldurk f2c401a255 Check that all states are present before allowing any stepping 2020-02-18 19:18:51 +00:00
baldurk 21b7168d5c Use pixel size not point size for global font scaling 2020-02-18 19:18:51 +00:00
baldurk f7cb742a4c Display capture file size in capture connection window. Closes #1723 2020-02-14 19:31:59 +00:00
baldurk 5977c2ef37 Fix compilation 2020-02-13 12:45:51 +00:00
baldurk 7d4685fc17 Fix exception catch-and-rethrow in extension BlockInvoke. Closes #1721 2020-02-13 11:01:45 +00:00
baldurk 5e6ec417c1 Add a global font scale option in settings window
* This lets the user override the default application font.
* Unfortunately Qt seems to behave inconsistently with font scaling from the
  system, so we take the font size initially from QApplication::font() (which
  doesn't always pick up the font size) and scale from there. While this might
  cause some font scaling to be lost it does mean at least we have a consistent
  scale, as otherwise you get some text scaling and others not.
2020-02-13 11:01:45 +00:00
baldurk 69a82202e5 Remove redundant/tautological checks 2020-02-13 11:01:45 +00:00
baldurk 9c091cf791 Fix memory leak in error case 2020-02-13 11:01:44 +00:00
Steve Karolewics dd69f8642a Add APIProperties for debugging and pixel history
Checks to enable debugging and pixel history are gated by the
APIProperties instead of whether the capture is D3D11. Shader
debugging for D3D12 is gated on a config option, which can be enabled
by adding "d3d12ShaderDebugging": "true" to the ConfigSettings
2020-02-12 21:58:33 +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
baldurk fe30fa91fb Fix python binding consistency with wrong naming scheme 2020-02-06 19:10:43 +00:00
baldurk 95ef40fe7c Add builtin to SourceVariableMapping 2020-02-06 17:58:42 +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 410f9d86bd Remove register/HLSL handling from shader viewer, work agnostically
* The shader viewer shouldn't handle specifics of D3D bytecode, instead it now
  works generally with whatever the debug and source variables are.
* VarType::Unknown is used for D3D registers which are typeless.
2020-02-06 17:58:41 +00:00
baldurk fdb6617cb1 Pass back 'registers' for resource bindings in debug trace 2020-02-06 17:58:41 +00:00
baldurk 0e0ff8714c Add fake source-mapping information for constants in debug traces
* cbuffer and input registers no longer have any names elided into them, they
  are 'raw' registers. The source mapping provides the information of where they
  come from as best as possible.
* Since we're now using source-mapping for constants, fix some source mapping
  issues with arrays, nested structs/arrays, and matrix major-ness.
2020-02-06 17:58:41 +00:00
baldurk 66cebe0a4c Refactor shader debug trace to have single mutable variable array
* Moving away from 'registers' explicitly being stored, we now have a single
  variable array where the shader representation is responsible for allocating
  it.
* In DXBC we calculate the number of each type of mutable variable (temps,
  indexable temps, and outputs) and assign slots linearly.
* We also update some naming - high-level variables aren't "locals" since they
  could be globals too, and debugging variables aren't "registers" but simply
  the variables we use for debugging which may be more complex than float4 for
  other APIs.
* The local variable matching by string name is unnecessary for this change
  but will be more useful in future after further refactors where there isn't
  a single list of variables to index into at the upper level.
2020-02-06 17:58:41 +00:00
baldurk 01461db738 Store mapping from instruction to disassembly line in shader debug trace
* This avoids having the UI need to do a scan and expecting to find
  "instruction:" on the start of a line.
* We also move the callstack to be stored per-step, and not in the line info
  mapping.
2020-02-06 17:58:41 +00:00
baldurk 14c1af06a3 Make ShaderViewer::ensureLineScrolled more conservative 2020-02-06 17:58:41 +00:00
baldurk 796f5ab328 Make sure scintilla margin is updated when text is updated 2020-02-06 17:58:41 +00:00
baldurk 08c0b13aaa Add further checks for windows being deleted during long async callbacks
* This is not really a full solution but fixes the common cases at least.
2020-02-05 15:06:53 +00:00
baldurk dd3c63e8ca Add resource usage for CPU writes to resources 2020-02-05 13:53:59 +00:00
baldurk 56fb75ff46 Fix formatting mistake in thread name 2020-02-03 18:18:16 +00:00
baldurk b38cbc1b0c Add explicit functions to initialise and shutdown replay. Closes #1685
* It's required for replay applications to call InitialiseReplay() before doing
  any work, and to call ShutdownReplay() once they're finished.
* This lets us do more heavyweight shutdown work before global destructors are
  being invoked and the RenderDoc instance is being destroyed.
* Anything that needs to be shut down during capture still has to happen in
  RenderDoc::~RenderDoc since we obviously can't get the application to call a
  shutdown function in that situation.
2020-01-30 13:39:15 +00:00
baldurk 066de4d1d0 Fix hover line rendering for ResourceId-only rich resource text painting 2020-01-29 11:48:04 +00:00
baldurk 1899b5ffc3 Pass size when fetching cbuffer variables 2020-01-27 20:45:08 +00:00
Steve Karolewics 0d2275ac02 Fix pixel pick value in D3D12 with a sRGB target 2020-01-22 19:05:37 +00:00
baldurk 6b1d186e6f Collapse variable initialisation & assignment into just init
* This doesn't make any difference but removes some warnings from PVS Studio and
  is slightly cleaner.
2020-01-21 18:28:56 +00:00
baldurk 7dd116abd4 Remove redundant/tautological comparisons identified by PVS Studio 2020-01-21 18:28:56 +00:00