Commit Graph
12152 Commits
Author SHA1 Message Date
baldurk 525906ab87 Serialise D3D12 SDK version in captures 2021-04-22 15:52:15 +01:00
baldurk 9dee6a64a8 Try to unload d3d12.dll when D3D12 replay is done
* This isn't always possible - it seems activating the debug layers causes
  d3d12.dll to be permanently resident.
2021-04-22 15:52:15 +01:00
baldurk 57224d06b6 Force ref-all-resources when root signature looks to be bindless
* This is required for the new heap-indexing bindless because we don't even have
  ranges to mark referenced, but for other cases ref-all resources tends to be
  more efficient especially when we're going to get to the same place (including
  all resources) via a less efficient mechanism.
2021-04-22 15:52:14 +01:00
baldurk 27c93f0c7c Update to latest D3D12 headers 2021-04-22 15:52:14 +01:00
baldurk 96afe77914 Disable hover pipeline thumbnails on remote replay
* Most remote replay links are slow enough that the lag introduced by
  synchronously fetching and displaying these thumbnails would be annoying for
  simple mouse-over scenarios.
2021-04-22 15:52:14 +01:00
Jake TurnerandBaldur Karlsson b37ed43ba3 Asynchronously run Apple APIs on the main thread
These operations now run on the main thread and not on the Replay thread
* Updating the NSOpenGLContext
* Setting the view property on the NSOpenGLContext
* Getting the window size from the NSView

The specific methods that are run on the main thread are:
* NSOpenGLContext setView
* NSOpenGLContext update
* NSView frame
* NSView convertSizeToBacking
* NSView setWantsBestResolutionOpenGLSurface

These methods are asynchronously dispatched to the main thread using the Apple NSApplication main thread dispatch queue i.e.

dispatch_async(dispatch_get_main_queue(), <method>);

The threading synchronization intent is:
* the Replay does not block waiting for a deferred main thread API to complete
* mutex locks are used to protect containers shared between the main and Replay threads
* the main thread uses a TryLock approach when wanting to acquire the context lock. If the context lock is held by the Replay thread then the main thread reschedules the requested context operation i.e.

if (TryToGetContectLock(context))
{
  [context update];
}
else
{
  scheduleContextUpdate(context);
}

* When scheduling requests to the main thread the NSOpenGLContext and NSView objects are referred to by an index into an array and not by pointer value.

There are two debugging modes which are disabled by default
* RD_THREAD_RANDOM_SLEEP
* RD_USE_CONTEXT_LOCK_COUNTS

Enabling RD_THREAD_RANDOM_SLEEP performs sleeps of random times on both the Replay and main thread when calling the different context and view methods.
RD_THREAD_RANDOM_SLEEP is useful to expose race conditions.

Enabling RD_USE_CONTEXT_LOCK_COUNTS tracks the lock count on the context objects in the "s_ContextLocksCount" container.

The low-level context locking is handled in NSGL_makeCurrentContext which is called from CGLPlatform::MakeContextCurrent which in turn is called from GLReplay::MakeCurrentReplayContext.

The currently locked context is tracked in TLS storage and the currently locked context is unlocked before locking the new context and then setting the current context TLS value.
2021-04-21 10:32:37 +01:00
Jinesi YelizatiandBaldur Karlsson 2c63b24cbc Fix a typo in streamio.h 2021-04-21 10:16:03 +01:00
baldurk d6c483a255 Hide tooltip thumbnail instead of making it 0x0 2021-04-20 14:44:04 +01:00
baldurk e3eb2ee754 Fix sorting for texture viewer texture list 2021-04-20 13:51:41 +01:00
baldurk 6f25063eb2 Add icon for context menu item to open in resource inspector 2021-04-20 13:51:41 +01:00
baldurk 9d3f7169ed Add thumbnails to texture tooltips in pipeline state view
* If there would be no tooltip otherwise, it just shows the thumbnail. Otherwise
  any tooltip text (like view parameters or image layout) is displayed below the
  thumbnail
2021-04-20 13:51:41 +01:00
baldurk 260583b805 Move tooltip handling from RDTreeWidget to RDTreeView 2021-04-20 13:51:41 +01:00
baldurk 9cb5e9d1b6 Update toolwindowmanager to 4837f70a84 2021-04-20 13:51:41 +01:00
Jinesi YelizatiandBaldur Karlsson c729397761 Fix typos in comments 2021-04-20 09:45:31 +01:00
baldurk 270d4e5b07 Add resource usage entries into context menu in pipeline state viewer 2021-04-19 16:44:19 +01:00
baldurk 12d9b4f850 Add copy icon to treeview context menu 2021-04-19 15:30:19 +01:00
baldurk 0a23f10d6f Clamp to subresource dimensions when binding sparse pages 2021-04-16 16:00:03 +01:00
baldurk db21020000 Ensure that overlay tests don't crash if multiple UAVs use register 0 2021-04-16 14:23:20 +01:00
baldurk 477a1e927b Add VK_Robustness2 test to autotests and add push descriptor interaction 2021-04-16 14:19:30 +01:00
baldurk da66701649 Don't mark bufferless constant buffers as empty due to stage masks
* These aren't present for push constants etc, so we ignore it
2021-04-16 13:55:38 +01:00
baldurk 47e13a30d4 Add test of GL renderbuffer variants 2021-04-16 13:31:08 +01:00
baldurk 8d5ede0e9d When getting texture data from multisampled renderbuffer, do blit first
* We can't use CopyTex2DMSToArray directly on a renderbuffer, we need to blit to
  the texture first.
2021-04-16 13:27:17 +01:00
baldurk eaee8a6878 Adjust renderbuffer samples to real number of samples obtained 2021-04-16 13:26:53 +01:00
baldurk 202dc9f14a Fix compilation with SINGLE_FLUSH_VALIDATE enabled 2021-04-16 11:42:52 +01:00
baldurk 8591d85c1d Fix reading of position-relative subpass inputs. Closes #2247 2021-04-16 11:42:52 +01:00
Jinesi YelizatiandBaldur Karlsson cf487e242b Fix typo in JDWP TypeTag enums
Even though TypeTag is not actually used.
2021-04-16 09:20:54 +01:00
baldurk 7f1f3caef0 Don't send empty opaque image binds 2021-04-15 22:14:12 +01:00
baldurk bbb3d409c8 Only check miptail parameters for compatibility when mip tail is present 2021-04-15 22:13:41 +01:00
baldurk 2720ff354a Test structured export/import of MSAA textures 2021-04-15 15:34:14 +01:00
baldurk cf50fef33a Support nested GetTempMemory calls on replay
* On capture we have a fast temporary thread-local memory allocator that only
  supports one allocation at a time, which is sufficient for unwrapping the
  parameters to a single function call.
* On replay though we might want to unwrap a function's parameters, and then
  inside do things like e.g. call a drawcall callback which makes its own calls
  that need to be unwrapped.
* To support these nested calls we instead allocate 4MB per thread on replay and
  use it like a ring buffer.
2021-04-15 15:34:14 +01:00
Aliya PazylbekovaandBaldur Karlsson 7b18d1c68e Fixing 2 issues with pixel history:
- Get framebuffer attachments from pipeline state (should account for
  imageless framebuffers)
- If there is no depth attachment, then depth bounds test and depth test
  do not modify coverage information
2021-04-15 15:34:08 +01:00
Jinesi YelizatiandBaldur Karlsson 98685bbcb5 Fix misleading log entry 2021-04-15 11:40:17 +01:00
baldurk f89b020cc7 Create DSV with proper descriptor in D3D12 quad overdraw 2021-04-15 11:15:54 +01:00
baldurk 2a61a7f32d Fix documentation build 2021-04-14 19:59:07 +01:00
baldurk 3ed516a7f6 Fix unit tests 2021-04-14 19:40:20 +01:00
baldurk 5b52bd7724 Treat API as unsupported if no frame capturers handle it. Closes #2222
* This is a bit coarse, as e.g. if you have one window that is unsupported on an
  API and another that is this will treat both as supported even if the active
  window doesn't support capturing. This is an unlikely case and needs a new UI
  to properly represent that.
2021-04-14 18:59:12 +01:00
baldurk eac94b74f6 Allow cbuffer previewer to apply custom format to non-buffer-backed CBs
* This in particular means push constants and specialization constants on vulkan
  but also applies to root-value cbuffers on D3D12.
* GL bare uniforms are not feasible to expose in this way.
2021-04-14 18:59:12 +01:00
baldurk 94b0b04483 Calculate texture byte size in GL as 64-bit
* It's unlikely drivers will survive >= 4GB textures but at least calculate the
  size correctly rather than truncating.
2021-04-14 11:22:54 +01:00
baldurk 208ab0fd7d Don't seek file until after it's checked for validity 2021-04-13 16:28:08 +01:00
baldurk 49e05bee72 Add error checking for textures failing to create 2021-04-13 16:27:58 +01:00
baldurk 7f939e2b7a If renderbuffer storage is re-created, don't create new readback texture 2021-04-13 14:26:04 +01:00
baldurk 4917fb0a96 Make debug logs about padded chunks a little less spammy 2021-04-13 13:25:18 +01:00
baldurk 00f352caeb Reserve a little more space in initial contents for sparse table
* Even if not present we serialise a bool indicating that it's not present,
  which needs to be reserved.
2021-04-13 13:25:04 +01:00
baldurk cb2b321a09 Ensure reserved descriptors are properly initialised
* We just want to change the number reported as 'real' descriptors for external
  replay/state queries
2021-04-13 13:21:52 +01:00
baldurk 376ac20af3 Compile fix 2021-04-12 21:20:01 +01:00
baldurk 1145447645 Fix descriptor write rollover to skip padding binds. Closes #2231 2021-04-12 19:48:48 +01:00
baldurk b9f9874c06 Enable shaderStorageImageMultisample at capture time for MSAA stores
* We need this to be able to add STORAGE_BIT to the image even if we don't do
  MSAA stores at capture time
2021-04-12 19:48:48 +01:00
baldurk e037795a85 Don't iterate over internal descriptors added to descriptor heap 2021-04-12 19:48:48 +01:00
baldurk 02e8e8fdf7 Patch imageless framebuffer image usage/formats to match image patching 2021-04-12 19:48:48 +01:00
baldurk 3bc996116d Fix identification of vendor UAV on SM5.1+ 2021-04-12 16:04:39 +01:00