Commit Graph

12193 Commits

Author SHA1 Message Date
baldurk cbb06800ab Remove unnecessary feature check on MSAA->Array copy 2021-04-30 10:31:08 +01:00
baldurk 9c29ae6393 Check for SRV/UAV typed access to 16-bit types
* This is possible on D3D11 but only with certain cap bits, it's simpler to test
  on D3D12 and the DXBC debugger will go through the same path for both.
2021-04-29 16:50:12 +01:00
baldurk 7ff6300843 Add test of D3D12 VRS features 2021-04-29 16:18:06 +01:00
baldurk ce99fd6569 Stringise new D3D12 resource states 2021-04-29 15:36:06 +01:00
baldurk 665c287679 Update toolwindowmanager to 23572b51 2021-04-29 15:31:51 +01:00
baldurk 2ea6d83b60 Handle new DXBC system-value semantics 2021-04-29 13:05:10 +01:00
baldurk 26aa09c665 Refactor D3D12 tests to check for options once in Prepare 2021-04-29 12:52:28 +01:00
baldurk aac9e762bc Test that empty execute indirects don't crash 2021-04-29 11:26:14 +01:00
baldurk f28a3a548f Remove call to FreeLibrary - GetModuleHandle doesn't add to lib refcount 2021-04-29 10:35:35 +01:00
baldurk 93f0997c12 Fix crash on 32-bit index buffers that are less than 4 bytes in size 2021-04-29 10:25:18 +01:00
baldurk f9054ffdf4 Create image view on depth/stencil in test to simplify behaviour 2021-04-28 16:30:17 +01:00
baldurk 0c0d57cc70 Add names to VK_Pixel_History test images 2021-04-28 16:30:07 +01:00
baldurk 57edff9f9e Transition pixel history image to layout matching the current renderpass 2021-04-28 16:29:56 +01:00
baldurk b70d157a35 Only ignore transitions from undefined current state for partial updates
* If the current state of a temporary ImageState is unknown in a renderpass
  transition mid-command buffer that means it's a subresource which isn't
  touched and we want to skip barriering it. We *don't* want to barrier from
  UNDEFINED and discard.
* However if this is a real ImageState which hasn't been initialised, we do want
  to do that. So only opt-in to the skipping behaviour in the case we know this
  isn't a 'real' ImageState but a temporary tracker.
2021-04-28 16:29:41 +01:00
baldurk 57c22874e3 Add required dynamic state for discard patterns PSO 2021-04-28 16:28:15 +01:00
baldurk 85aef09a5b Don't rely on depthOut member of DrawcallDescription 2021-04-28 16:19:31 +01:00
baldurk a252136c81 Handle VK_WHOLE_SIZE in memory flush of mapped tiled memory 2021-04-28 12:35:28 +01:00
baldurk a4cba2af13 When grabbing D3D12Core also grab D3D12SDKLayers for validation
* The D3D12SDKLayers needs to match the D3D12Core, so we save both when possible
  (the SDKLayers dll might not be loaded during capture but it should be next to
  the D3D12Core. On replay if we have one we put it next to the D3D12Core we're
  using for replay, and if not we forcibly disable debug otherwise we may crash.
2021-04-28 12:21:57 +01:00
baldurk aedf0cc701 Handle D3D12 hooked libraries on replay moving in memory on reload 2021-04-28 11:59:10 +01:00
baldurk 6b37477e35 Update d3dcommon.h and stringise new D3D feature level 2021-04-28 11:24:04 +01:00
baldurk 52612c1f66 Apply out-of-bounds index count clamping to VS output 2021-04-28 10:36:59 +01:00
baldurk 2e0af1e3ca Fix string issues 2021-04-27 17:13:18 +01:00
Jake Turner 5b2203d9d2 Mac support to get executable path from .app file 2021-04-26 21:58:13 +01:00
Jake Turner da660cd025 Removed redundant RENDERDOC_PLATFORM_APPLE code 2021-04-26 21:58:13 +01:00
Theodore Cipicchio 1e3fc0e320 Fix row count calculation when writing block-compressed DDS data
Block-compressed textures with dimensions that are not evenly divisible
by the block size are typically padded internally to align with the
block size. load_dds_from_file() was previously corrected to account for
this alignment when calculating the number of rows of blocks to read
from a DDS file, but the fix was not applied to write_dds_to_file(),
resulting in missing rows of texels or loading failures when attempting
to open a DDS file generated by RenderDoc from a texture whose
dimensions are not a multiple of four.
2021-04-26 12:18:15 +01:00
Jake Turner e8cfbd5a6f Mac build set the minimum SDK version to 10.15 2021-04-26 11:38:44 +01:00
baldurk aa0be4ee47 Fix unit test expectations for proper truncated components 2021-04-23 20:33:43 +01:00
baldurk acf9987055 Keep chunk allocator memory in resource records in D3D12
* These records can then be kept alive during capture even if the resource is
  released.
2021-04-23 20:33:28 +01:00
baldurk e8e4e64182 Don't pass rdcstr through varargs for log print 2021-04-23 20:08:28 +01:00
baldurk cc2d736301 Remove piece in documentation that caused more problems than it solved 2021-04-23 19:07:31 +01:00
baldurk e78a48bfc3 Implement proper out-of-bounds value filling for vulkan post-vs fetch 2021-04-23 19:07:31 +01:00
baldurk 659c75319b Bounds check input attributes against input array size we have 2021-04-23 19:07:31 +01:00
baldurk 203c4d688e Add buffer_device_address path to vertex output fetch on vulkan 2021-04-23 19:07:31 +01:00
baldurk dc5a26ece5 Refactor vulkan post-vertex output to read all data from SSBOs 2021-04-23 19:07:31 +01:00
baldurk 2da070ad55 Fix VK_CBuffer_Zoo test when inline data extension isn't supported 2021-04-23 19:07:30 +01:00
baldurk 226178ddac Explicitly set layer count when doing MSAA <-> Array copies 2021-04-23 19:07:30 +01:00
Jake Turner 87d5295926 Disable pyrenderdoc on Apple
The python brew install does not include universal binaries
Disabling pyrenderdoc on Apple allows for the generation of universal binaries by the Apple CI
2021-04-23 09:20:26 +01:00
Jake Turner bcfaed393d Build Apple universal binaries arm64 & x86_64 2021-04-23 09:20:26 +01:00
baldurk d18cf78188 32-bit compile fix 2021-04-22 16:31:21 +01:00
baldurk f4d4c1862e Use minimal function hooking to allow dynamic D3D12 runtime selection
* By intercepting D3D12.dll's load of D3D12Core.dll and wrapping the COM
  interface it gets back, we can load the D3D12Core.dll that we desired.
* As a default, we load the D3D12Core.dll embedded in the capture. There's also
  a config setting to allow the user to override this, though in principle this
  shouldn't be needed.
* We only do all this if the SDK version used to capture is higher than that
  normally available on the system. So if a new runtime isn't in use, we won't
  do any hooking at all.
2021-04-22 15:52:15 +01:00
baldurk 2b74938ccd When present, embed D3D12Core.dll into the capture
* This way we know we have the right matching version for use on replay.
2021-04-22 15:52:15 +01:00
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 Turner 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 Yelizati 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