Commit Graph

1863 Commits

Author SHA1 Message Date
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
baldurk 8fa93105f2 Fix some casts/calculations to keep PVS Studio happy
* It identifies some potential overflows which we know likely won't happen, but
  the fixes are harmless.
* Some issues are definitely bad, though not actual bugs.
2020-01-21 18:28:56 +00:00
baldurk baac06ca93 Remove redundant/dead code identified by PVS Studio 2020-01-21 18:28:56 +00:00
baldurk a5c54b3ce7 Don't pass event ID to PickVertex()
* It's meaningless to try and pick on any other event but the current one
2020-01-20 17:44:34 +00:00
baldurk 210626ae18 When updating postvs position/secondary configs, reset camera properties 2020-01-20 14:32:22 +00:00
baldurk cd3ef3dd55 Fix near/far plane specifiers being backwards 2020-01-20 14:28:59 +00:00
baldurk 42841e23be Expose vulkan layer registration in renderdoccmd on win32. Closes #1690
* This is needed so that the functional tests can elevate and run renderdoccmd
  to register the vulkan layer, if needed.
* At the same time remove the old spammy message and ignore flag - this dates
  back to before the UI existed, and that should be the way users run RenderDoc
  generally and it has a good UI for walking through layer registration if
  needed.
* The command is always available, but will only show up in help if attention is
  needed.
* Also fix registering installs on shared drives.
2020-01-20 11:46:48 +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 4a587da167 Account for byte offset when expanding arrays in bufferviewer formatter 2020-01-17 19:53:38 +00:00
baldurk df266eb04d Fix some version properties in windows resource files 2020-01-14 18:02:10 +00:00
baldurk a2562200f7 Hide update check progress bar even if network error occurred 2020-01-14 18:02:10 +00:00
baldurk f4ab28205f Add option to non-interactively resolve callstack symbols
* Primarily for use in scripts
2020-01-13 18:29:50 +00:00
baldurk e9182377e5 NULL out connection handle after shutdown 2020-01-13 16:55:05 +00:00
baldurk bc6401f23a Don't refresh overlay unnecessarily when it's not enabled 2020-01-10 12:55:26 +00:00
baldurk cb0e8958b1 in debug builds don't include resource ID when renaming resources 2020-01-10 11:01:05 +00:00
Steve Karolewics 824188d047 Fix text contrast in pixel history view with dark UI theme 2020-01-09 17:56:54 +00:00
baldurk ff37dc9787 Update APK installation failure message to mention USB APK installs
* Apparently some android devices don't allow installation of APKs over USB by
  default.
2020-01-07 17:28:17 +00:00
baldurk 10aa4662ec Add deliberate fall-through comment into scintilla code 2020-01-07 17:28:17 +00:00
baldurk 7b678a4dae Add missing break in android error-mapping switch 2020-01-07 17:28:17 +00:00
baldurk 77b76b98a8 Allow -Wimplicit-fallthrough on qrenderdoc project 2020-01-07 17:28:17 +00:00
Steve Karolewics bbd2a4ecb0 Implement D3D12Replay::DebugThread
Also added logic for initiating debugging in the D3D12 pipeline state
viewer. Both locations are guarded by defines for now.
2020-01-07 17:28:01 +00:00
baldurk c43d9146a9 Use globbing to get dependencies for swig builds
* Fixes a warning in VS2019 from stale warnings and should mean rebuilds are
  more accurate too.
2020-01-06 16:25:34 +00:00
baldurk 9ede309c39 Update qrenderdoc README 2020-01-06 16:20:45 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk 27098f8f70 Give our threads debugger-friendly names 2019-12-19 21:50:13 +00:00
baldurk 7ff0796b89 Check for incomplete textures on OpenGL. closes #214 2019-12-18 19:09:18 +00:00
baldurk 2c80a7206b Enable 'enum value not handled' warning on MSVC, fix issues
* Mostly we add an explicit default: break but in some cases we add explicit
  cases and/or error messages.
2019-12-17 18:02:10 +00:00
baldurk e302ecfe83 Don't leak target control handle 2019-12-17 15:51:16 +00:00
baldurk 93b0d65726 Override new/delete for structured data objects to go through our allocs
* Otherwise if structured data cross a module boundary the (de)allocation could
  fail.
* We also ban new/delete for structs that don't need it
2019-12-17 14:51:11 +00:00
baldurk 14d01ff995 Remove support for serialising STL types, remove STL interop 2019-12-16 18:10:32 +00:00
baldurk c4ca8cb1d1 Reduce reliance on big public headers where possible
* Mostly moving includes from common headers to cpp where possible, and removing
  includes of the whole thing where only enums or rdcstr etc are needed.
2019-12-16 17:06:16 +00:00