Commit Graph

233 Commits

Author SHA1 Message Date
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
baldurk 2411ce70ea Add flags to ResourceFormat to replace bgraOrder/srgbCorrected
* Allows for future expansion as well
2018-12-11 19:57:20 +00:00
Sebastian Krzyszkowiak 9d21221617 TextureViewer: fix wheel zooming on HiDPI screens
Without adjusting for pixel ratio it zoomed in into a wrong place.
2018-12-11 11:05:49 +00:00
baldurk 57caf01394 Refactor heatmap for quad overdraw/triangle size to be applied late
* Instead of baking these into the overlay texture and trying to decode them
  afterwards, we instead write a grayscale 16F value into the overlay texture,
  and add a special decode display mode that will use the heatmap and bucketing
  provided.
* This means that saving these overlay textures now saves grayscale. When saving
  to an 8-bit format, we remap to 0-255 so that greater than 1.0 values are
  mapped lower.
2018-11-01 12:23:12 +00:00
baldurk 8447e43e78 Fix panel menus 2018-10-23 15:15:39 +01:00
baldurk 94dfb9890b Allow registering window, panel and context menu items with callbacks 2018-10-23 14:23:12 +01:00
baldurk 5472319025 When opening buffer textures, auto-generate a reasonable buffer format. 2018-10-11 11:09:36 +01:00
baldurk 615b743b8e Make shader debugging soft-blocking, pop up progress bar while working
* This prevents the user from accidentally triggering some other process while
  the debug is still on-going, if it's taking a while.
2018-10-08 17:24:00 +01:00
baldurk 66e8c6f9ff Don't set invalid zoom level when no previous texture size is set 2018-09-28 15:03:12 +01:00
baldurk 684e814eb7 Protect access to TextureViewer from custom shader editor
* This means we don't crash if the custom shader editor is kept open even when
  the texture viewer is closed.
2018-09-18 12:46:23 +01:00
baldurk a4e125f961 Fix thumbnails being drawn over whole resource preview 2018-09-05 09:58:16 +01:00