Commit Graph

14178 Commits

Author SHA1 Message Date
Jake Turner d72d79052a Extend Vk Depth Test Overlays
Support shader exported depth by replaying using the capture pixel shader to determine passing pixels
2023-11-27 16:33:57 +00:00
baldurk 1246f8007a Restore hack to get homebrew working again 2023-11-22 17:14:48 +00:00
baldurk 800c321d16 Re-order vertex bindings to match sensible order. Closes #3145 2023-11-22 15:30:10 +00:00
baldurk 9e79ba3416 Fix DXIL patching for quad overdraw
* Also tweak the test output to be more organised
2023-11-20 18:17:51 +00:00
baldurk b9c338568f Set the correct type for i8 metadata constants in DXIL 2023-11-20 18:17:21 +00:00
baldurk 9082c985c6 Remove deferred swapchain memory flag 2023-11-20 15:19:16 +00:00
baldurk 7db65dc01b Allocate dynamic SSBO descriptors in our debug descriptor pool 2023-11-20 13:59:21 +00:00
baldurk 0d9ea809dd Fix some test failures by consistently stripping gl_PerVertex_Var prefix 2023-11-17 18:47:47 +00:00
baldurk 48222bf5bb Disable reporting of multiviewMeshShader feature 2023-11-17 18:47:47 +00:00
baldurk 58f206eed0 Get output topology reflection on D3D12 for mesh shaders 2023-11-17 18:47:47 +00:00
baldurk 10face5f4c Avoid error by checking for NULL first before accessing const members 2023-11-17 18:47:47 +00:00
shaltupssen 21972fa5b4 Fix abi name for android x86 2023-11-17 10:21:43 +00:00
baldurk 41d2e69d00 Remove unused lambda captures 2023-11-17 02:00:20 +00:00
baldurk 98dd806298 Remove duplicate docstring 2023-11-17 01:59:18 +00:00
baldurk 3976bba298 Add missing documentation strings 2023-11-17 01:43:19 +00:00
baldurk d171cdb1c6 Fix compilation on 32-bit 2023-11-17 01:39:52 +00:00
baldurk 70b2fac658 Fix compile warning on some D3D12 HLSL compiler versions 2023-11-17 00:47:55 +00:00
baldurk 07b1c3f857 Add options to filter and correlate between task and mesh invocations 2023-11-17 00:47:55 +00:00
baldurk 1df7c1ae81 Implement mesh viewer support for task/mesh shaders 2023-11-17 00:47:55 +00:00
baldurk d898e2ac09 Detect and prevent crashes on broken dxc-produced task shaders 2023-11-17 00:47:55 +00:00
baldurk 8f945ab404 Use shader patching functions to fetch amp. & mesh outputs on D3D12 2023-11-17 00:47:28 +00:00
baldurk 4e12adfab1 Add function to patch mesh shader DXIL to store mesh output
* See equivalent previous Vulkan commit for more notes.
2023-11-17 00:47:28 +00:00
baldurk 882cd8c9ec Add function to patch amp. shader DXIL to feed from buffer 2023-11-17 00:47:28 +00:00
baldurk 980677f50c Add function to patch DXIL to fetch amp. shader outputs 2023-11-17 00:47:28 +00:00
baldurk 2f3a0640f5 Use shader patching functions to fetch task & mesh outputs on Vulkan 2023-11-17 00:47:27 +00:00
baldurk 4a7a9375aa Add a function to store mesh output data
* This function patches a mesh shader to write to BDA instead of the output
  object, as well as storing the vertex/primitive count. It separates indices,
  per-vertex rate outputs and per-primitive rate outputs. The output is stored
  not fully interleaved because we replace pointers in-place and they may be
  combined if an output is a struct.
* If preceeded by a task shader, it will read a per-dispatch offset to account
  for the fact that each task group produces an independent series of mesh
  groups that can't differentiate from each other. Within that set of groups,
  each group assigns its output linearly and this output will potentially be
  sparse as it's sized based on the worst case output.
2023-11-17 00:12:42 +00:00
baldurk 957f330c63 Add function to patch task shader into fixed data feeder
* This task shader is relatively degenerate, it just loads payload & dispatch
  size from a buffer, writes to the payload, and dispatches. Used to
  deterministically replay the same set of tasks as were saved.
2023-11-16 23:44:16 +00:00
baldurk 9996c8c38a Add function for fetching task shader outputs on Vulkan
* We do this by patching the shader to write to BDA pointers instead of Payload
  pointers for all payload pointers, and also store the number of meshes
  dispatched.
* After running this shader we'll read the results back and then feed the data
  back onto the GPU via our own task shader, to ensure we can conservatively
  size the mesh output buffer accounting for whatever task shader expansion
  happened.
2023-11-16 23:44:16 +00:00
baldurk 54fdac1d44 Factor out near/far derivation into common driver code 2023-11-16 23:44:16 +00:00
baldurk b0c97182f6 Implement baseline mesh shader on D3D12 2023-11-16 18:20:24 +00:00
baldurk 5ad3e67a2d Implement baseline mesh shader on vulkan
* This supports capture and replay of mesh draws, shader editing with printf
  support, overlays, and pixel shader debugging.
* Not supported yet include the mesh viewer and shader debugging.
2023-11-16 18:20:24 +00:00
baldurk cc80757e4e Add DXIL reflection for task/mesh shaders 2023-11-16 18:20:23 +00:00
baldurk 66d0a10142 Add SPIR-V reflection for task/mesh shaders 2023-11-16 18:20:23 +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 788f68a1f7 Improve DXIL bytecode editor
* Add helpers for creating DX op instructions with less boilerplate.
* On encode, strip any unused functions or globals to comply with strict
  DXIL validation requirements.
* Create attribute sets on demand to match functions.
* Add some extra helpers for creating constants, blocks, and patching
  runtime chunk.
2023-11-16 18:20:23 +00:00
Jake Turner 6ea7710380 Use a contrasting fore ground colour for BufferFormat error style
This makes it automatically work for Light or Dark theme
2023-11-16 09:00:14 +00:00
Jake Turner 7d2094d52b Add a link to "below section" to the buffer viewer struct docs 2023-11-16 09:00:14 +00:00
baldurk 2758c080c8 Disassemble inner coverage variable correctly. Closes #3137 2023-11-15 14:51:04 +00:00
baldurk 0ed8c5eb4c Limit device core vulkan version to declared instance version
* This prevents us from returning function pointers that should be NULL for core
  functionality (or promoted extension functionality) which an application may
  see and then try to call. The spec requires us to return NULL for these cases
  (except for non-maint5 future core versions, but we can legally return NULL
  there and that's the correct thing to do as the maint5 feature bit is stupid).
2023-11-15 14:51:04 +00:00
baldurk d9fd975138 Add a test of unmapping read-only persistent buffers on GL 2023-11-15 14:51:04 +00:00
Steve Karolewics caef1b9c69 Add D3D12 per fragment callback for pixel history
This callback gets info for each fragment of a draw during pixel
history, to determine which ones were discarded and why.
2023-11-13 16:26:48 +00:00
baldurk f2c1435a7d Make it more clear that wayland is unsupported at build time. Refs #3124 2023-11-13 11:45:39 +00:00
baldurk 4a1d1896b7 Try to avoid being forced onto unsupported wayland path. Refs #3124 2023-11-13 11:45:39 +00:00
baldurk b2667b4e2e Unmaps of persistently mapped readonly buffers aren't writes. Refs #3124 2023-11-13 11:45:39 +00:00
Jake Turner e9b7dfcc4c Extend D3D12 Depth Test Overlays
Support shader exported depth by replaying using the capture pixel shader to determine passing pixels
2023-11-13 10:56:01 +00:00
jathoma98 bcb7dfd3ae Update stb_image version 2.12 -> 2.28
stb_image v2.12 has a memory corruption bug, updated to v2.28 to fix.

The only real API change is stb_image_resize.h is now stb_image_resize2.h, and stbir_resize_uint8_srgb() doesnt take alpha channels or flags as params.
2023-11-11 13:07:25 +00:00
Steve Karolewics 73c604d2f0 Add D3D12 test failed callback for pixel history
This callback determines which tests passed or failed for a given
draw during pixel history. The set of tests mirrors the Vulkan
implementation, with some adjustments for D3D12 capabilities.
The code for updating PixelModification structs during pixel
history is included as well since they're related.
2023-11-10 09:52:07 +00:00
William Pearson e03d7c9002 Fix links in buffer format help
The buffer format help can be accessed via first opening the raw
buffer viewer (e.g. from the actions section on the texture viewer),
and then clicking the "?" under saved formats. It includes a nice
summary of the format syntax, but says that "Exhaustive documentation
can be found in the online docs." That was supposed to include a link
to https://renderdoc.org/docs/how/how_buffer_format.html, and in fact
it renders as if it were link, but clicking on it did nothing.

This has been fixed by adding `Qt::LinksAccessibleByMouse` and
`Qt::LinksAccessibleByKeyboard` to `textInteractionFlags`, and also
setting `openExternalLinks` to true (which requires use of a
`QTextBrowser` instead of a `QTextEdit`). I left the full list of flags
as `Qt::TextBrowserInteraction` does not include the
`TextSelectableByKeyboard` flag (which seems useful here and was
included before).

I verified that other uses of links work properly via checking all of
them found via `git grep href`:
* CaptureContext: Uses `QMessageBox` which defers to the style's `SH_MessageBox_TextInteractionFlags` which in practice has at least `Qt::LinksAccessibleByMouse`:
  * https://github.com/qt/qtbase/blob/v5.15.11-lts-lgpl/src/plugins/styles/mac/qmacstyle_mac.mm#L2850-L2852
  * https://github.com/qt/qtbase/blob/v5.15.11-lts-lgpl/src/widgets/styles/qcommonstyle.cpp#L5303-L5305
  * https://github.com/qt/qtbase/blob/v5.15.11-lts-lgpl/src/widgets/styles/qfusionstyle.cpp#L3702-L3703
* AboutDialog: sets `openExternalLinks` to true on the `version` and `contact` labels in the ui file
* AnalyticsConfirmDialog and AnalyticsPromptDialog: uses `on_label_linkActivated` as an automatic slot (as it needs custom handling for opening the documented analytics report)
* SettingsDialog: uses `on_analyticsDescribeLabel_linkActivated` as an automatic slot (and only has an internal link for opening the documented analytics report)
* CrashDialog: several different ones:
  * captureFilename works via `on_captureFilename_linkActivated` as an automatic slot (and opens a file in explorer)
  * reportText has `openExternalLinks` in the ui file
  * on_send_clicked uses `RDDialog::information` with an email address, which uses `QMessageBox` (see CaptureContext)
  * finishedText has `openExternalLinks` in the ui file
* ExtensionManager: sets `openExternalLinks` to true on the `URL` and `author` labels in the ui file
* TipsDialog: sets `openExternalLinks` to true on the `tipUrlLabel` label in the ui file
* nv_counter_enumerator.cpp: sets `openExternalLinks` to true on the `counterDescription` label in PerformanceCounterSelection.ui
2023-11-09 17:57:02 +00:00
William Pearson a64c24ff96 Add missing brackets to docs/how/how_buffer_format.rst 2023-11-09 17:57:02 +00:00
Jake Turner 74b0a8b1a7 Small tweaks to GL and HLSL shaders used to copy depth for Depth overlay 2023-11-09 15:10:54 +00:00