Commit Graph

243 Commits

Author SHA1 Message Date
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
baldurk 186ca30045 Treat binding viewcasts are always definitive
* On APIs like vulkan the view casting happens from an already typed format, so
  don't assume that casts are only applied when the underlying format is
  typeless. When a cast is not valid the view format should never be different
  from the underlying image format as the API should never make it possible to
  validly create or bind a view with a different format.
2019-11-26 17:38:26 +00:00
baldurk db563bb0bf Refactor public interface around handling of textures
* Subresource handling is more consistent - we pass around a struct now that
  contains the array slice, mip level, and sample. We remove the concept of
  'MSAA textures count samples as extra slices within the real slices' and
  internalise that completely. This also means we have a consistent set
  everywhere that we need to refer to a subresource.
* Functions that used to be in the ReplayOutput and use a couple of implicit
  parameters from the texture viewer configuration are now in the
  ReplayController and take them explicitly. This includes GetMinMax,
  GetHistogram, and PickPixel.
* Since these functions aren't ReplayOutput relative, if you want to decode the
  custom shader texture or the overlay texture you need to pass that ID
  directly.
2019-11-26 17:38:25 +00:00
baldurk 01344c7e83 Rename typeHint to typeCast 2019-11-26 17:38:25 +00:00
baldurk e713c82dcd The slice parameter for 3D textures should be mip-relative too 2019-11-13 10:05:31 +00:00
baldurk 3fbb9ee7ad PickPixel's x and y parameters should be mip-relative
* Previously x and y always ranged from 0,0 to width-1,height-1. Even for lower
  mips, the value was just effectively shifted.
* This is quite unclear at the API level so instead x and y are now relative to
  the selected mip's dimensions.
2019-11-13 10:05:30 +00:00
baldurk ee2a491f20 Fix status bar display of A8 textures 2019-10-25 18:29:30 +01:00
baldurk fd5fd7269a Split up texture viewer status bar into separate items to wrap better 2019-10-21 13:56:10 +01:00
baldurk 8ce2ea2202 Improve calculation of histogram
* The histogram shouldn't be calculated as channel-wise averages, but instead by
  'stacking' the channels (each channel contributes 1 to the appropriate
  bucket).
* Degenerate channels (where min==max) are excluded and listed only as a single
  spike, to avoid blowing out the automatic y-axis.
2019-10-10 16:48:42 +01:00
Steve Karolewics 70e3499ea1 Check component count for right click pixel value in texture viewer 2019-07-12 13:58:11 +01:00
Steve Karolewics 7ff5841885 Check type hint for auto fit range button in texture viewer. 2019-07-11 10:37:33 +01:00
baldurk e4333291a1 Allow using shader processing tools for custom shaders
* This is primarily useful for HLSL on Vulkan, but could be used with any other
  combination. If multiple tools can perform the conversion, the highest
  priority one is used.
2019-05-22 17:54:10 +01:00
baldurk c83a087400 Don't pass negative firstMip/firstSlice
* These can be -1 to indicate that all mips/slices are available - so pass 0 in
  that case.
2019-05-21 13:29:43 +01:00
baldurk 06feec392d Use pipeline base mip/slice binding for texture thumbnails. Closes #1327 2019-05-20 13:13:47 +01:00
baldurk e48065c96b Replace use of std::pair with rdcpair wherever possible
* Only remaining uses in our code is when we're interacting with std::map where
  it uses std::pair internally
2019-05-17 16:32:56 +01:00
baldurk 96cc08b960 Rename 'show disabled' button to 'show unused' as it is clearer
* Bindings that are unused aren't disabled - they may in fact be explicitly
  enabled - but they are unused by the pipeline which is why they're hidden.
2019-05-17 16:32:55 +01:00
baldurk c8a518f05c Refactor rdcstr with small-string and literal-string optimisations
* rdcstr no longer inherits from rdcarray, it implements all functionality
  itself.
* There are now three representations:
  - Heap-allocated, same as how rdcarray behaves.
  - Local-allocated, for small strings we store them in a union array.
  - Compile-time literal, only created from user-defined literals.
* The main observation is that a lot of RenderDoc's strings are compile-time
  literals either from struct names, member names, or stringified enum values.
  Storing these directly and allowing them to be moved and copied quickly saves
  on allocations and time. When the string is modified, it's copied to one of the other formats.
2019-05-15 14:12:17 +01:00
baldurk e13671a72c Add sanity check for if dock area isn't available while restoring layout 2019-04-22 18:39:53 +01:00
baldurk 11e8bdb209 Display default 'viewed as' for typeless textures. Closes #1351
* Typeless textures must be interpreted as some kind of format, so without a
  better hint we use UNORM as a default. Ensure that this is listed explicitly
2019-04-22 18:39:52 +01:00
baldurk f256218e17 Pass bindless feedback data to UI through vulkan pipeline state
* Each binding element within an arrayed descriptor has a bool indicating if
  it's dynamically used or not (which will be set to true if the feedback isn't
  available). Each descriptor has a uint32_t indicating how many elements are
  dynamically used - which is useful for the UI to hide the root of an array
  that has no used elements, or to heuristically decide whether to expand or
  elide the contents.
2019-04-05 09:19:22 +01:00
baldurk 4319c5c2ab Calculate the slice properly for viewing MSAA textures as buffers 2019-04-03 16:42:41 +01:00
Vincent de Marignac f970d42c2c Set bound on right arrow keypress to width 2019-03-25 09:05:13 -07:00
baldurk f20e871510 Add option to make y-flipping a per-texture state instead of global 2019-02-04 18:06:10 +00:00
baldurk 86ff87863e Update copyright years to 2019 2019-02-01 18:32:13 +00:00
baldurk 150e6527ad If a texture is typeless then account for type hint when pixel picking 2019-01-09 16:27:15 +00:00
baldurk 2237c241ff Fix incorrectly named methods in ResourceFormat
* We try to maintain at least an internally consistent naming scheme for the
  python/public interface, even if it doesn't match python naming schemes.
2019-01-03 12:22:29 +00:00
baldurk 1617b4618d Fix crash on GL after saving a texture to disk, wrong thread access 2018-12-21 12:38:28 +00:00
baldurk 13e7d1c134 Support display of YUV textures on D3D11, D3D12 and Vulkan
* Supported textures are decoded into standard format of YUVA, displayed
  visually with Y in green, U in blue, V in red.
* A new texture display mode 'YUVA decode' has been added which does a default
  full-range conversion from YUV to RGB.
* Custom shaders can be used to implement a custom decode matrix.
2018-12-14 20:14:07 +00:00
baldurk 1cb0f29198 Update channels detail when HDR multiplied text is edited 2018-12-13 18:00:26 +00:00