Commit Graph

103 Commits

Author SHA1 Message Date
baldurk 73ec1e1d37 Don't assume text output byte buffer is null terminated 2018-09-25 10:39:59 +01:00
baldurk a05d63852e Fix label for shader processing tools in disassembly dropdown 2018-08-28 18:23:57 +01:00
baldurk babe36bf7e Preserve stdout/stderr from external shader tools and display to user 2018-08-15 13:40:21 +01:00
baldurk 3c7b420e59 Expand SPIR-V disassemblers to general shader processing tools
* Instead of just configuring SPIR-V disassemblers and picking only the first
  one when we need to edit SPIR-V, we allow setting up any shader processor that
  goes between two shader encodings.
* When editing, the default will still be to use embedded source, and then after
  that the first tool that goes from the native shader format to a text format,
  but the drop-down allows you to pick any of them.
* Similarly in the shader viewer you can configure the compilation options and
  method, to choose the compiler you want to use. Embedded command line
  parameters in the shader are automatically appended.
2018-08-09 16:56:53 +01:00
baldurk a81e4a2b45 Pass through and allow different source shader encodings when editing
* This means e.g. the D3D11 back-end can accept DXBC directly if the UI can
  provide it, or compile from HLSL as before.
* More importantly, the Vulkan back-end can take SPIR-V compiled from any
  source, or compile from GLSL as before as a fall-back.
2018-08-09 16:56:52 +01:00
baldurk 74528c4d15 Allow saving state internally by key as well as externally 2018-08-06 16:23:03 +01:00
baldurk edc5815463 Move expansion saving to RDTreeView so it can be used in more places. 2018-08-06 16:23:02 +01:00
Dzmitry Malyshau 9c9e61a95e Remove unused this in lambdas of ShaderViewer 2018-07-03 22:08:28 +01:00
baldurk 89637d8b35 32-bit compile fix 2018-06-22 21:36:06 +01:00
baldurk ec2806df06 Add context menu for manipulating watch panel 2018-06-22 19:28:34 +01:00
baldurk fc3e527181 If D3DCOMPILE_SKIP_OPTIMIZATION is set, prefer source-level debugging 2018-06-22 19:28:34 +01:00
baldurk 04f214c768 Add toolbar button to switch between HLSL and assembly debugging
* This hopefully makes the HLSL debug mode more obvious to people.
2018-06-22 19:28:34 +01:00
baldurk c5689827a9 Allow clicking anywhere in rX.xyzw to highlight register 2018-06-22 19:28:34 +01:00
baldurk c0317855f8 Show tooltips for known local variables and constants 2018-06-22 19:28:34 +01:00
baldurk 2a6a0f0f95 Support local variables in watch expressions 2018-06-22 19:28:34 +01:00
baldurk 1761f5ab36 Highlight variables/registers that have changed 2018-06-22 19:28:33 +01:00
baldurk 5b3a12cd0c Save and restore tree expansion state when repopulating locals widget 2018-06-22 19:28:33 +01:00
baldurk cb0df2c844 Combine together structs/arrays in HLSL locals panel 2018-06-22 19:28:33 +01:00
baldurk 880f529fda Change mapping representation to be gather-based per variable
* Instead of having an N:N mapping of parts of variables to parts of registers,
  instead we gather everything together under each variable and it has a list of
  registers that comprise it.
* Any gaps are represented as undefined register mappings, for components that
  aren't available in any register.
2018-06-22 19:28:33 +01:00
baldurk 8b5ab06da7 Rename variables panel to registers 2018-06-22 19:28:32 +01:00
baldurk 06b7e39c26 Don't crash if stepping back from last instruction 2018-06-22 19:28:32 +01:00
baldurk 377715a61f Don't create tabs for completely empty files in shader viewer 2018-06-22 19:28:32 +01:00
baldurk 2b7d9aea38 Create a line-to-instruction map to allow breakpoints/cursor-run in HLSL 2018-06-22 19:28:30 +01:00
baldurk 52e9a6c01d Pass through line-mapping information for each instruction to UI
* This lets the UI highlight the source line as stepping happens, as well as
  allowing stepping purely in HLSL.
2018-06-22 19:28:30 +01:00
baldurk ff9f5675e9 Display high-level language locals corresponding to registers 2018-06-22 19:28:30 +01:00
baldurk e2dcd902cd Gather and display callstack information during shader debugging 2018-06-22 19:28:30 +01:00
baldurk 14e3a3d360 Move API-agnostic pipeline state wrapper into core interface
* There's no need for this to be in the UI, and moving it allows it to be used
  from script which is very useful.
2018-06-18 18:39:06 +01:00
baldurk 5c40914c32 Set disassembly view to NULL when it's deleted 2018-05-13 10:13:49 +01:00
baldurk 082ab4d75d GUIInvoke takes a QObject* to avoid callbacks after object lifetime
* The GUIInvoke object takes a QObject, and uses QPointer to check that
  it hasn't been deleted when the callback fires. This prevents delayed
  callbacks from executing after the object has been deleted and
  crashing.
* In most cases the pointer is just 'this'.
2018-05-08 11:54:34 +01:00
baldurk 4f32e62886 Align shader tooltips to account for negative 9-digit ints. Closes #964 2018-04-23 14:04:56 +01:00
baldurk 3224df835b Fix disassembly view not working in shader viewer list of files 2018-04-09 17:11:26 +01:00
Baldur Karlsson 68a3f3a31f Filter out previous/next drawcall shortcuts when text editing.
Closes #911

editing.
path.
'ad0678a'.
2018-03-12 15:46:44 +00:00
baldurk f3fdf79d8a Allow resizing of variables/constants columns 2018-02-24 23:22:22 +00:00
baldurk d3bf628394 Handle opening vulkan shaders that are not in a pipeline.
* Previously we were relying on the pipeline info create to initialise
  the reflection for an entry point, now we do it on demand wherever it
  is needed.
2018-02-09 19:03:55 +00:00
baldurk f6ccd537b6 Change shader edit controls from Ctrl-S / save to F5 / Refresh
* This is a bit less ambiguous and less confusing in the case where
  someone is expecting a "compile" type button instead of "save changes"
  type button.
2018-02-09 17:19:29 +00:00
baldurk 1f0fdcacce Update window title after fetching shader stage 2018-02-09 01:32:50 +00:00
baldurk 65ef82466c Re-organise Analytics structures a bit to be more processing friendly 2018-01-19 13:57:02 +00:00
baldurk fd899cdb96 Fix disassembly not being on top when first debugging a shader 2018-01-17 21:07:04 +00:00
baldurk 34fc993b59 Calculate column widths with devicePixelRatio 2018-01-16 20:12:06 +00:00
baldurk e305029ddd Update copyright years to 2018 2018-01-01 17:55:29 +00:00
baldurk 2b083b7910 Add options for UI-configured SPIR-V disassemblers to shader viewer 2017-12-22 17:03:10 +00:00
baldurk ebaefc82a9 Normalise and make python/public interface more consistent
* We enforce a naming scheme more strongly - types, member functions,
  and enum values must be UpperCaseCamel, and member variables must be
  lowerCaseCamel. No underscores allowed.
* eventId not eventID or EID, and Id preferred to ID in general. Also
  for resourceId.
* Removed some lingering hungarian m_Foo naming.
* Some pipeline state structs that are almost identical between the
  different APIs are pulled out into common structs. Where something
  doesn't make sense (e.g. viewport enable for vulkan) it will just be
  set to a sensible default (in that case always true).
* Changed scissors to be x/y & width/height instead of sometimes
  left/top/right/bottom
* Abbreviations are discouraged, e.g. operation not op, function not
  func.
2017-12-22 13:02:36 +00:00
baldurk 0b527fab49 Use rdc types instead of Qt containers in public QRenderDoc interface
* This is to support python bindings - the pyside implementation of
  QVector, QString, etc is not available to SWIG, so SWIG treates these
  all as opaque types.
* Rather than trying to set up bindings that work for rdcarray and
  QList/QVector, or implementing separate bindings, we instead just say
  that the public interface must use the rdc types. In most cases they
  seamlessly convert to/from Qt types anyway.
* In a couple of places we use an array of pairs instead of a map. In
  future we probably want an rdcdict or rdcmap with proper dict bindings
  in python.
2017-12-13 22:43:01 +00:00
baldurk a6ebf09785 Add analytics system - disabled for now
* This is a *very* light-touch analytics system that will track the
  simplest and most anonymous statistics that can be useful in
  determining which features are most used or perhaps underused, and
  where it's best to direct development attention.
* It is entirely implemented in the UI layer, no analytics-gathering
  code exists in the library that's injected into programs, and of
  course no capture data (screenshots, resource contents, shaders, etc
  etc) is transmitted.
* Once it's turned on, it will apply to both development and release
  builds. It tracks stats over a month, and then at the beginning of a
  new month it sends the previous data.
* When the user first starts up a build with analytics if there's no
  previous analytics database then they are informed of the new code and
  asked to approve it. They have the option of selecting to manually
  verify any sent reports, or just opt-ing out entirely.
2017-11-29 19:01:22 +00:00
baldurk 1d05177141 Add Qt helper for constructin rdcstr directly from QString 2017-11-29 19:01:21 +00:00
baldurk 602511bf33 Reduce parameters that need to be passed for viewing shaders 2017-11-22 19:11:27 +00:00
baldurk 38acc56084 Unregister shortcuts when closing windows that registered shortcuts
* This prevents leaking for cases where new widgets are created (and
  the small chance a widget pointer could be re-used and cause serious
  problems), and multiple-registration errors for global shortcuts.
2017-11-22 19:11:25 +00:00
Cory Bloor 58b628ee8b Fix unused variables
In almost all cases these can be removed. The only exception is in
ShaderViewer.cpp, where regIdx should have been used.
2017-11-18 00:17:06 +01:00
baldurk 33ff48811b Normalise terminology in UI code - don't call captures 'logs'
* Log is an overloaded term since it can also mean the debug log. We now
  consistently refer to capture files as capture files or just captures
  for short. The log is just for log messages and diagnostics.
* The user-facing UI was mostly already consistent, but many of the
  public interfaces exposed to python needed to be renamed, and it made
  more sense just to make everything consistent.
2017-11-17 16:30:57 +00:00
baldurk 2ac0802b10 When a custom name is changed, refresh the UI to propagate it properly 2017-11-17 16:30:54 +00:00