Commit Graph

313 Commits

Author SHA1 Message Date
baldurk 205ed0e6fa Remove old shader bindpoint mapping handling entirely 2024-04-10 18:58:52 +01:00
baldurk 2bbe1a8cd9 Update shader viewer and debugging with new reporting for shader binds
* This shifts from reporting from the old style bindset/bind to the new system
  of only referencing by shader interface and index (independent of binding
  model).
* The vulkan shader debugger re-uses the replay interface to cache descriptor
  access and descriptor contents in a fashion friendly to interface-index
  lookup.
2024-04-10 18:58:51 +01:00
baldurk f718e72ac9 Update texture viewer to use new pipeline helpers 2024-04-10 18:58:51 +01:00
Jake Turner 3cb8998841 Vulkan DebugPixel support for multiview debugging
Output "ViewIndex" into the pixel shader hits array
Select the pixel shader input which matches the viewIndex to the passed in view
Ignore the view parameter if set to ~0U (rd.ReplayController.NoPreference)
Ignore the view parameter if any subpass has empty multiviews
2024-03-13 07:58:48 +00:00
Jake Turner 7934d1d16e Change DebugPixel() to take a DebugShaderInputs struct
DebugShaderInputs struct contains existing the parameters:

sample
primitive

and a new parameter

view

Default constructor for DebugShaderInputs sets the parameters to NoPreference (~0U).
2024-03-13 07:58:48 +00:00
baldurk 3e2340fe16 Add identified support for slang (the language and the tool) 2024-03-01 12:11:37 +00:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
baldurk 9fe2ec5c2d Fix calculation of slices on 3D textures when viewing up/down mips 2023-12-04 19:11:27 +00:00
baldurk 69dcb42a05 Add enums and API-agnostic handling for new task and mesh shader stages
* The enums are given after compute, to preserve indices for the normal vertex
  pipeline.
* Mesh dispatches are considered a new action type, rather than being bundled
  into the `Drawcall` type. This will allow them to be distinguished by API
  backends as needed. The UI treats them as drawcalls
* We apply this universally even though it's not relevant to D3D11/GL. It means
  a couple of empty array entries but it should not cause any significant
  issues.
* Shader messages will be identified by group and thread as with compute
  shaders. For mesh shaders there is an additional subdivision to identify them
  by task group, since each task group can submit a grid of mesh groups.
2023-11-16 18:20:23 +00:00
baldurk 9d39b8e1a8 Reformat code for clang-format 15 2023-09-05 11:02:08 +01:00
baldurk e7430226e9 Match SPIR-V version as much as possible when rebuilding shaders 2023-08-22 13:41:39 +01:00
baldurk 3ba61e20a6 Fix handling of proxying S8 textures 2023-03-16 16:55:21 +00:00
baldurk d47e79ae07 Update copyright years to 2023 2023-02-01 12:23:32 +00:00
baldurk 9eaabe516a Fix calculation of mip co-ordinates. Closes #2836
* Also adds a unit test to verify these helpers
2023-01-27 14:13:21 +00:00
baldurk b8b9fff7f0 Fix order, update texture before fetching histogram. Closes #2828
* This is only relevant when using a custom shader since otherwise nothing is
  'updated', though could also affect overlays potentially. If we don't then the
  custom shader texture may not have been re-rendered before we fetch the
  histogram data and we'll get stale information.
2023-01-25 10:38:16 +00:00
Leonard Tsai f578e62684 Allow multiple depth targets to be viewable in the TextureViewer 2023-01-18 12:56:47 +00:00
baldurk bc2faaf3e6 Track preview when calling UI callbacks to avoid use-after-free 2023-01-05 16:39:51 +00:00
baldurk 0acb955e19 Create virtual distinction between Vulkan & GL SPIR-V. Closes #2798
* This distinction unfortunately does not exist in SPIR-V so we have to carry
  around this metadata ourselves. Rather than allowing free specification of
  tools based on API, instead pretend that Vulkan and GL SPIR-V are separate
  format, and duplicate all SPIR-V tools to handle "both" types. This allows
  appropriate tool selection based on the encoding.
2022-12-27 13:39:44 +00:00
baldurk b5545d52f8 Fix float precision/rounding issues for NPOT textures. Closes #2807 2022-12-27 12:23:05 +00:00
baldurk f0644a2257 Fix issue where multiple thumbnails would be added for overlapping binds
* Previously we iterated over each bind, and found the matching resources. Now
  we iterate over resources and find the matching bind. This matters when there
  are multiple overlapping binds so they are only found once (we don't
  disambguate which bind was used, as we don't elsewhere currently)
2022-11-09 14:15:15 +00:00
baldurk d11da2f3a1 Refactor texture viewer thumbnails to not use swapchains
* There seems to be a significant slowdown when using real swapchains, both for
  creation and display. Since thumbnails don't update often (only on event
  change, or if the panel is resized which is not a regular occurence)
  counterintuitively it's better to render and readback the image offscreen and
  re-upload it on the CPU.
2022-11-09 14:14:24 +00:00
baldurk 336e90d412 Display special D3D quality levels in texture viewer 2022-09-12 13:54:07 +01:00
baldurk e061ea3b2e Improve handling of compilers & command line for edited shaders
* We store the compiler used (when known) in shader debug info and use that to
  select the compiler for editing as even higher priority than the default for a
  given language/encoding combination.
* We also ensure that for known tools we add the input and output parameters
  last, after any custom parameters, so that they are always present regardless
  of what the user puts in.
2022-08-10 14:56:44 +01:00
baldurk 234262649f Fix calculation of small mip co-ordinates for NPOT textures 2022-07-15 18:07:08 +01:00
baldurk 8838a878e8 Show the current event in texture viewer usage context menu 2022-06-22 20:04:42 +01:00
baldurk 1eee00f01d Remove unnecessary sRGB conversions 2022-06-16 16:30:00 +01:00
baldurk f01dfbecc1 Add a python extension function to access picked location. Refs #2065 2022-05-31 11:26:59 +01:00
baldurk 8aa0390948 Add string messages to returned result codes to display to user
* Most of the main entry points that can fail with relevant reasons now has a
  way of specifying a message to return with it. This message can be displayed
  to the user to give more information or context about an error.
2022-04-26 16:21:54 +01:00
baldurk 1ae2afc05a Apply shader prefix even if encoding is directly accepted. Closes #2561
* The prefix, if available, must always be applied for custom shaders to compile
  correctly.
2022-04-22 12:55:40 +01:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00
baldurk 3ac4bd0ebd Refactor custom shaders to abstract binding differences. Closes #2458
* Newly written shaders and any updated shaders can now use pre-defined macros
  to abstract away binding differences between APIs, so custom shaders will be
  more portable in particular shaders written in HLSL for D3D or GLSL on OpenGL
  won't break on vulkan because they refer to incorrect binds.
2022-01-31 19:14:08 +00:00
baldurk 54fa3a7802 Recalculate scrollbar limits after switching textures. Closes #2470 2022-01-28 13:49:48 +00:00
baldurk bfbc9a3e48 Fix order of scrollbar update when texture scale changes. Closes #2377
* We need to update the scrollbar bounds first based on the current zoom level,
  then change the scroll position. Otherwise the scroll will be visually correct
  but the scrollbars won't match.
2021-10-04 12:10:56 +01:00
baldurk a21d245114 Remove show unused/show empty options from texture viewer 2021-08-26 09:51:37 +01:00
baldurk 7149302680 Rename 'draw' or 'drawcall' to action
* There's not a good accepted terminology for this kind of event, and for
  historical reasons 'drawcall' has been the accepted term, even though
  that can be quite confusing when a dispatch or a copy is a 'drawcall'.
* This is particularly highlighted by the event browser filters where
  $draw() includes draws and dispatches, but $dispatch() only includes
  dispatches, it's hard to intuitively understand why $draw() matches all
  of these calls.
* As a result we've defined the term 'action' to cover these types of
  events in the same way that we defined 'event' in the first place to
  mean a single atomic API call.
2021-07-01 15:15:05 +01:00
baldurk d8d6557feb Add support for file includes from custom shaders. Closes #2275 2021-05-17 13:47:58 +01:00
baldurk 331db5b4ba Fix custom shader edits to write the exact editor contents to disk 2021-05-17 13:47:58 +01:00
lizj 5fde0ad90d Fix incorrect backcolorPick button state after cancellation 2021-05-10 14:18:19 +01:00
baldurk e3eb2ee754 Fix sorting for texture viewer texture list 2021-04-20 13:51:41 +01:00
baldurk 95e6a4a971 Respect font scale for fixed-width fonts 2021-04-12 13:04:02 +01:00
baldurk 6a6b7f68e1 Display thumbnails for empty resources 2021-04-12 13:04:02 +01:00
baldurk 527c662fb2 Only flip Y co-ordinates in texture viewer when clip origin is default 2021-03-01 11:38:29 +00:00
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