Commit Graph
820 Commits
Author SHA1 Message Date
baldurk af67b951de Ensure descriptor sizes are properly initialised in default pipe state 2024-06-04 10:08:08 +01:00
baldurk 153cd2aa16 Expose queries for descriptor stores and D3D12 root signature range
* This will allow a UI viewer or consumer of the replay API to more easily query
  'all' descriptors for a given store.
2024-04-10 18:58:53 +01:00
baldurk 0284d551ea Switch from specific Attachment structs to using Descriptor for outputs 2024-04-10 18:58:52 +01:00
baldurk 205ed0e6fa Remove old shader bindpoint mapping handling entirely 2024-04-10 18:58:52 +01:00
baldurk d88aad8fc2 Add a query to determine logical identifiers for descriptors
* This is a consideration for any cases where binding numbers are relevant -
  primarily D3D11 and GL - where the offset into an arbitrary (and possibly
  fake) descriptor storage is not helpful but knowing the register binding
  definitely is.
* If someone wants to look at the raw descriptor contents without respect to a
  particular shader access they can use this query to determine a more useful
  'name' for any given descriptor. On D3D11 and GL this gives the register
  number, on Vulkan it gives the binding number (and array element). On D3D12 it
  just repeats the offset effectively.
2024-04-10 18:58:50 +01:00
baldurk b9787606ea Add reported descriptor access from vulkan and D3D12 bindless feedback 2024-04-10 16:31:17 +01:00
baldurk 227842a295 Add a structure and query for reporting descriptor accesses 2024-04-10 15:33:36 +01:00
baldurk b94e6ff90c Add a stubbed out query for pulling descriptor contents out of a store 2024-04-10 15:01:26 +01: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 ec17ee5999 Batch calls to GetPostVSBuffers to work around Android being awful
* On Android the end-to-end latency of a single call is large enough that doing
  a call per-instance in a draw with a high number of instances is a real
  problem
2024-02-23 15:00:28 +00:00
Jake Turner a62634717e Vulkan BDA debugging force m_BufferAddresses to be sorted
The implementation usage of m_BufferAddresses assumes the container is sorted and requires the use of lower_bound() API

Added rdcsortedflatmap subclass of rdcflatmap
Only expose upper_bound(), lower_bound() APIs in rdcsortedflatmap
The upper/lower bound APIs require a sorted container
2024-02-13 17:03:42 +00:00
baldurk 9f4f0e6aa1 Update copyright years to 2024 2024-02-12 11:04:52 +00:00
james-sumihiro 783d76fe73 Fix two handle leaks during remote probe
Added logic to the entry point RENDERDOC_CreateRemoteServerConnection to shutdown the socket used to connect to a remote device when the function is used to test a connection (IRemoteServer **rend is null.) This previously created a handle leak, visible as accumulating /device/afd/ file handles on Windows.

Added logic to the Windows specialization of Process::LaunchProcess so it will close two handles: hChildStdError_Rd, and hChildStdOutput_Rd if the handles were created successfully but the process failed to launch. Previously these would accumulate during a remote probe for Android devices if ADB was not present or otherwise failed to launch.
2024-01-15 10:54:01 +00:00
Jake Turner e34de6b0ab Sparse structs serialisation markup for Offset, Size type fields 2023-12-06 17:19:05 +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
Jake Turner 788a0ca98f Zero initialize read_dds_data before loading DDS file 2023-08-25 10:20:28 +01:00
Jake Turner d0388f1f20 Fix bug in y-flipping code in ResamplePixels() Closes #3025
In GL captures causes the generated thumbnail image to be incorrect for the middle two rows of the image.
2023-08-18 07:03:53 +01:00
Jake Turner 2d53aa2a32 Add unit tests to ResamplePixels()
Tests:
y-flipping: true/false
BGRA: true/false
Downsample from 4x4 to 2x2
2023-08-18 07:03:53 +01:00
baldurk cd897063e3 Make error message more explicit when proxy texture fails to create 2023-08-14 16:37:04 +01:00
baldurk 9995c1f0cf Protect against invalid socket data potentially causing crashes 2023-08-04 17:06:03 +01:00
baldurk 7c1164e060 Tidy up and implement support for self capture on linux 2023-07-31 15:45:32 +01:00
baldurk a34f890604 Disallow EXR files that are too large 2023-06-22 13:09:25 +01:00
baldurk 3f7e648d4d Fix invalid type lookup for empty type string. Closes #2947 2023-06-02 21:55:49 +01:00
baldurk 0f851df6c2 Batch prepare and allow limited buffering for vulkan initial states
* We add a capture option that defines a soft limit we aim to keep under for
  memory overhead during capture, excess initial states after that will be
  stored temporarily on disk.
2023-06-02 18:53:45 +01:00
baldurk 1f72a09e3b Sanitise strings printed when received from target control/remote server
* Given socket corruption or network errors these strings could contain
  unprintable characters so we sanitise them reasonably. This also ameliorates a
  potential security concern with arbitrary strings being written to a log, but
  these connections are still considered trusted and users should not be
  exposing RenderDoc ports to the internet.
2023-05-19 10:28:58 +01:00
baldurk 7a088ac898 Handle some errors better without stalling in replay proxy networking 2023-03-16 16:55:21 +00: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 cfe4d08c81 Use the proper calculation for partial-miptail wrapped updates 2023-01-17 14:15:08 +00:00
baldurk 72c9cbf37f Lock around access to capturer list
* This removes a potential narrow race where a capturer is removed or added on
  one thread while another thread is iterating the list of capturers for target
  control communication.
2023-01-11 18:37:53 +00:00
baldurk 900ff975b3 Don't drop sRGB flag when getting texture data. Refs #2787
* This would cause incorrect data to be saved when saving from an SRGB texture
  to an SRGB format like PNG/JPG etc.
2022-12-15 15:20:11 +00:00
baldurk dfe07d6822 Update application API to 1.6.0, add capture title setter 2022-11-21 13:49:15 +00:00
baldurk 2e276a7f84 Remove rdcarray sized constructor 2022-11-09 13:22:53 +00:00
baldurk 3f9bf1ab27 Fix crash handler not launching as expected in official builds 2022-11-01 16:33:37 +00:00
baldurk e36c247c6e Upgrade some non-spammy useful log messages from debug logs 2022-10-26 17:09:23 +01:00
baldurk 10d4c69433 Skip unmapped subresources when serialising sparse init states on D3D12 2022-10-26 17:09:05 +01:00
baldurk 4612d71df5 Switch some maps to unordered in resource manager 2022-10-26 13:08:17 +01:00
baldurk 39920c1b71 Show the version running when connecting to incompatible remote server 2022-10-03 20:10:41 +01:00
baldurk a8f0fb1736 Stop forcing references for resourced invalidated by freed bound memory 2022-08-07 18:56:11 +01:00
baldurk 33ea305efd Show message in connection window for unsupported API capture
* This is helpful when the normal overlay is not available or visible such as in
  VR headsets
2022-08-05 13:03:32 +01:00
Jake Turner 2d6290bab1 Basic Metal capture support
Captures can be manually triggered from renderdoccmd capture <application> using F12 or from the UI on the in-development Metal replay branch.
The captures can be loaded and replayed on the in-development Metal replay branch.

The command buffer tracking and serialization are done by GPU submission order which is not necessarily the same as CPU commit order. The command buffer tracking for GPU submission order is currently using an rdcarray, this might change in the future to use a linked list if the performance of appending and deleting from the rdcarray becomes a performance bottleneck.

Does not include support for the presented MTLDrawable ie.
* Thumbnail generation of the final presented image.
* Serializing the presented texture ID.

Does not include support for initial state data.
No MTLBuffer data contents are serialized.

There is a lot missing and a lot of TODOs. 
This is the basic structure for capturing which is then built upon. 

Includes:
* register the Metal device as a frame capturer ie. AddDeviceFrameCapturer
* logic for triggering captures at Present ie. AddActiveDriver, StartFrameCapture, EndFrameCapture.
* Stopped declaring MetalResourceManager as a friend of WrappedMTLDevice which meant making the initial state-related APIs public instead of private.
* IFrameCapturer interface APIs
* Command buffer tracking for including in the output capture CaptureCmdBufCommit and CaptureCmdBufEnqueue.
* Serialise_MTLCreateSystemDefaultDevice(SerialiserType &ser)
* A helper class MetalCapturer which is derived from IFrameCapturer and registered with the RenderDoc instance. This is because Wrapped Metal classes can't have virtual tables as a requirement for how the C++ and Objective C overlay is implemented.
* The frame capture chunk and API AddFrameCaptureRecordChunk
* MetalInitParams data and serialization.

Helper Methods and Members in MTLDevice
* WaitForGPU()
* MTL::CommandQueue *m_mtlCommandQueue which is used to implement WaitForGPU()
* CaptureClearSubmittedCmdBuffers() & CaptureCmdBufSubmit()
* RegisterMetalLayer() & UnregisterMetalLayer() used to track active Metal swapchains

Details on the memory lifetime for WrappedMTLCommandBuffer

retain the real resource in WrappedMTLCommandBuffer::commit()
release the real resource when no longer needed to be tracked: for background capture in during WrappedMTLDevice::CaptureCmdBufSubmit, for active capture in WrappedMTLDevice::EndFrameCapture.

During capture (Background or Active)
* AddRef() record when command buffer is enqueued (explicit or implicit)
* Delete() record at end of command buffer submit

During Active capture
* AddRef() record in command buffer submit
* Delete() submitted command buffers as part of finalizing the capture

Added TrackedCAMetalLayer & ObjCTrackedCAMetalLayer to track the lifetime of CA::MetalLayer.
The CA::MetalLayer is tracked in the hook for CAMetalLayer::nextDrawable(), with ObjCTrackedCAMetalLayer set as an association to the CAMetalLayer. Then ObjCTrackedCAMetalLayer::dealloc() triggers ending the tracking.
2022-07-18 12:41:44 +01:00
baldurk 1e8425c3e6 Refactor handling of device/window pairs and overlay text 2022-06-14 18:05:07 +01:00
baldurk 4103f6a545 Properly zero initialise DDS return structure 2022-04-28 11:39:11 +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 9ceff0a91b Fix handling of sub-page-sized mip tails with D3D-style wrapped set 2022-04-08 17:45:24 +01:00
baldurk b35b744ada Verify captures are still present before showing them in connection
* If the RenderDoc UI connects to a program, opens then deletes the captures,
  then closes and is opened again - we don't want to report those deleted
  captures as if they still exist. This now clears out any captures that no
  longer exist.
2022-03-07 14:45:44 +00:00
baldurk b17ea43b65 Remove some static variables that aren't needed 2022-02-24 19:00:34 +00:00
baldurk 60e1f86571 Fix xml handling of arrays when loading config 2022-02-17 17:38:32 +00:00
baldurk fcdea67879 Update copyright years to 2022 2022-02-17 17:38:32 +00:00