Commit Graph

271 Commits

Author SHA1 Message Date
baldurk ba06717842 Don't fetch resource lists for unbound shader stages
* This is a minor optimisation when there are large numbers of bound resources
  that are available (duplicated) to all shader stages. There's no point
  fetching them when there's no shader bound there.
2021-01-21 11:30:50 +00:00
baldurk c002c71fe8 Don't display buffers as thumbnails in texture viewer
* This is a holdover from simpler binding times, these days it makes more sense
  to omit buffers than try to hold onto those bindings even when they don't
  contain textures.
2021-01-21 10:43:37 +00:00
baldurk 40f83cfbfd Fix lag in updating texture viewer display when selecting new draws 2021-01-20 17:15:34 +00:00
baldurk 99725b1dc4 Use devicePixelRatioF to calculate texture viewer coords. Closes #2148 2021-01-14 12:03:07 +00:00
baldurk 026da176bb Update copyright years to 2021 2021-01-13 13:56:10 +00:00
baldurk f3b66b0112 Only refresh texture list if resource renames changed
* Otherwise the texture list doesn't change when selecting events.
2020-12-17 15:20:32 +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 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 df6fec13f9 Remove use of automodule in docs
* One automodule in a file for our modules is way too much, so we split it into
  files. Unfortunately this means that only one file can have those classes and
  functions be linkable from elsewhere.
* Instead we bite the bullet and manually curate the items into pages, and at
  the same time subdivide the 'enums and data' page more which is a general
  readability and usability win as well.
* We also add some previously not-included functions, and add a doc-build time
  check to ensure that functions and classes aren't omitted from the
  documentation in future
2020-12-07 17:44:50 +00:00
baldurk a34d7b1965 Don't bind Qt signals multiple times for custom paint widgets 2020-11-24 16:29:36 +00:00
baldurk 58e16414e0 Add a number of control functions to the Qt python interface 2020-11-20 17:02:33 +00:00
baldurk 3f5a911483 Refactor CustomPaintWidget to handle widget recreation internally
* This allows us to expose to to python as a easy-to-use "replay output ready"
  widget.
2020-11-19 14:47:11 +00:00
baldurk ab28d102cd Fix bug allowing users to close unclosable texture viewer panels 2020-11-09 12:25:20 +00:00
baldurk 695ffaaf24 When viewing a texture from pipeline state, default to view typecast 2020-10-30 16:28:03 +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
Kevin McCullough e213cfafa9 Modifying the TextureList to use EventBrowser-style chooser. 2020-10-15 22:19:44 +01:00
baldurk 55c57f7e89 Display stencil values in binary and decimal in tooltips. Closes #2052 2020-10-01 15:56:52 +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 ec023ac660 Avoid unnecessary re-layouts when populating thumbnails 2020-09-03 18:07:47 +01:00
baldurk c39a0bae5f Re-jig Following to hold a reference to TextureViewer
* This simplifies the code flow because we can be sure that we always have
  cached read-only/read-write resources (this was true before, but now it's
  clear).
2020-09-03 18:07:47 +01:00
baldurk e61794dd88 Don't forcibly change tab in texture viewer when one is closed 2020-09-01 10:27:45 +01:00
baldurk 5ef45a3576 Apply output mip/slice when selecting a new texture or new drawcall 2020-07-16 20:45:19 +01:00
baldurk 152db57598 Default A8 textures to show the alpha channel only 2020-07-15 11:50:56 +01:00
baldurk 88591c35fd Collapse large arrays if no dynamic use information is available 2020-07-12 10:52:10 +01:00
baldurk dfc82b3bd2 Prevent debugging graphics stages if no drawcall is selected 2020-06-29 18:34:07 +01:00
baldurk d4ddb565d0 Add a per-shader debuggable flag to allow finer grained status
* E.g. on D3D12 we can debug DXBC shaders but not DXIL shaders. On vulkan this
  will allow us to have the UI work better when encountering shaders with
  unsupported capabilities or extensions.
2020-06-18 17:22:45 +01:00
alex 9414beaed2 Support multiple custom shaders directories for Texture Viewer 2020-06-16 11:47:52 +01:00
alex c1612f5d46 Add Texture Viewer custom shaders directory setting 2020-06-16 11:47:52 +01:00
baldurk a0a373a8e1 Fix handling of buffer truncation and zero-sized buffers 2020-05-29 17:26:29 +01:00
Daniel Craig 4ad21c4198 Fix HWND resize timing issue
* There was a race condition where the newly created HWND surface could
  be resized during swap chain creation. This causes a
  `VK_ERROR_DEVICE_LOST`, but is very timing dependent.
* The fix was to finish the resize, via `ResourcePreview::setActive()` /
  `QWidget::show()` before scheduling any async functions that could
  create a swapchain, namely `IReplayOutput::AddThumbnail()`.
2020-05-28 23:27:56 +01:00
baldurk 22d5cf2313 Scroll selected pixel to centre on goto. Refs #1885 2020-05-15 20:50:55 +01:00
baldurk 7d233f074c Don't launch pixel history on failure if the feature is not supported 2020-04-28 18:15:33 +01:00
Steve Karolewics ade2325623 Cache resources fetched from the pipe state in the texture viewer 2020-04-28 18:15:20 +01:00
Steve Karolewics 1137c4694c Make D3D12Pipe root element centric instead of shader centric
D3D12Pipe now stores an array of root elements, each one corresponding
to a root element or range in the root signature. Migrated usage in the
D3D12 pipeline state viewer and PipeState retrieval of resources.
Restricted number of resource array textures displayed in the texture
viewer to prevent app hangs.
2020-04-08 18:38:38 +01:00
Daniel Craig fc63964335 Show correct clear/CopyDst/CopySrc subresource in texture viewer
This is implemented and tested on vulkan/d3d12/d3d11.
2020-04-06 20:12:05 +01:00
baldurk 9ba81634b4 Improve the title of shader edit windows 2020-04-03 15:19:28 +01:00
baldurk 4f39279578 When opening a texture in raw buffer viewer, scroll to selected point 2020-03-13 18:00:34 +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 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
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
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
Steve Karolewics 0d2275ac02 Fix pixel pick value in D3D12 with a sRGB target 2020-01-22 19:05:37 +00:00
baldurk 7dd116abd4 Remove redundant/tautological comparisons identified by PVS Studio 2020-01-21 18:28:56 +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 bc6401f23a Don't refresh overlay unnecessarily when it's not enabled 2020-01-10 12:55:26 +00:00
baldurk 2916c0f9f7 Update copyright years to 2020 2020-01-06 16:20:45 +00:00
baldurk b3979262a5 Replace FormatElement with ShaderConstant/ShaderVariableType
* FormatElement is now a static BufferFormatter class to help generate and parse
  buffer formatting strings
2019-11-29 13:53:44 +00:00
baldurk b0afdd2988 Don't force typecast from real texture when saving overlay/custom shader 2019-11-27 11:06:03 +00:00