Commit Graph

10107 Commits

Author SHA1 Message Date
baldurk 56fb75ff46 Fix formatting mistake in thread name 2020-02-03 18:18:16 +00:00
Steve Karolewics 1dc4d5b15e Display the demos UI if argv[1] isn't a valid test 2020-02-03 18:18:03 +00:00
Steve Karolewics 9b72d79c06 UI improvements for the demos UI
Made the API filters inclusive, so that if any are checked, only the
selected ones are shown. If none are selected, then all tests are
shown as before. Moved the test name filter to the top pane, so that
it is always visible - before if you scrolled down in the test list,
it would be hidden. Added more room for test descriptions in the bottom
pane - long descriptions were previously truncated.
2020-01-31 20:08:25 +00:00
Steve Karolewics b2150e901f Fix D3D12 sharing test when the adapters used by D3D11/D3D12 differ
D3D11 may default to a different adapter than D3D12. For the sharing
test, both adapters must be D3D12 compatible. Tell D3D11 to use the
adapter that D3D12 is using to ensure compatibility.

Also fixed a memory leak in the test.
2020-01-31 20:08:25 +00:00
Steve Karolewics 2f7b260d39 Try creating a device with successive adapters until one succeeds.
On laptops with integrated+discrete adapters, adapter 0 may not
support D3D12, so a default create device call will fail. Adapters
other than the 0th one need to be specified explicitly.
2020-01-31 20:08:25 +00:00
baldurk 385121d2ca Fix android deadlock on shutdown 2020-01-30 14:34:54 +00:00
baldurk a8071679bd Fix renderdoccmd commands 2020-01-30 14:21:32 +00:00
baldurk b38cbc1b0c Add explicit functions to initialise and shutdown replay. Closes #1685
* It's required for replay applications to call InitialiseReplay() before doing
  any work, and to call ShutdownReplay() once they're finished.
* This lets us do more heavyweight shutdown work before global destructors are
  being invoked and the RenderDoc instance is being destroyed.
* Anything that needs to be shut down during capture still has to happen in
  RenderDoc::~RenderDoc since we obviously can't get the application to call a
  shutdown function in that situation.
2020-01-30 13:39:15 +00:00
baldurk e1fe211f3c Rename Shutdown to RemoveHooks in in-application API. Version is 1.4.1
* This is a binary and source backwards compatible change.
2020-01-30 13:02:23 +00:00
baldurk 0f827d5784 Use backdoor context when a context is needed for capture. Closes #1701
* This fixes the case where no context is current on the thread starting and
  ending the frame capture, but also all existing contexts are current on other
  threads and can't be temporarily used.
2020-01-30 11:28:01 +00:00
baldurk 627391be7e Fix lookups of UAV data when debugging groupshared access 2020-01-29 15:44:10 +00:00
baldurk 066de4d1d0 Fix hover line rendering for ResourceId-only rich resource text painting 2020-01-29 11:48:04 +00:00
baldurk 291bec7091 Fix global hooking code 2020-01-29 10:22:43 +00:00
baldurk a98bc5dde4 Handle optional pSizes parameter to vkCmdBindTransformFeedbackBuffersEXT 2020-01-28 18:44:54 +00:00
baldurk ea0de0c065 Conditionally enable bufferDeviceAddressCaptureReplay in VK1.2 features
* This struct might be passed without the parent bufferDeviceAddress feature
  being enabled, e.g. if capture replay wasn't supported and we claimed no
  support, or if there's really no support. We can't unconditionally enable
  capture replay like we can with the extension structs (which are only passed
  if the extension is available, and we only allow it to be available if the
  feature is available).
2020-01-28 18:44:54 +00:00
Steve Karolewics 1c764ca518 Fix constant buffer lookups with SM5.1 shader debugging
Constant buffers store some additional state when parsed from DXBC
to make it easier to fix the match and know the correct size. The
debug trace still stores a simple array of CBuffers, but the shader
debug code provides a BindingSlot and uses the ShaderBindpointMapping
to find the logical identifier that shader instructions will use to
reference the constant buffer.
2020-01-28 18:44:37 +00:00
baldurk d377c4e0cf Fix documentation compile error 2020-01-27 21:38:51 +00:00
baldurk d827e0a2f1 Fix again the handling of physical device extension functions 2020-01-27 20:45:08 +00:00
baldurk ff50bfc95e Use correct command list when doing manual clears for D3D12 render pass 2020-01-27 20:45:08 +00:00
baldurk da7d27fe9b Explicitly list versions of all android build components supported 2020-01-27 20:45:08 +00:00
baldurk 560a9669f2 Log java versions in both PATH and under JAVA_HOME 2020-01-27 20:45:08 +00:00
baldurk 4e53297535 Don't pass 0xdeadbeef marker values to GL from client-side buffers
* The actual offsets will be overridden when client side buffers are used -
  these marker values are left-over from client side buffers being present when
  preparing a VAO's initial contents.
2020-01-27 20:45:08 +00:00
baldurk 83f0398aa6 Add test to parameter zoo to catch descriptor referencing resources 2020-01-27 20:45:08 +00:00
baldurk 1899b5ffc3 Pass size when fetching cbuffer variables 2020-01-27 20:45:08 +00:00
baldurk d2cd2f0291 Check that vkCmdFillBuffer usage is properly populated in VK_Indirect 2020-01-27 20:45:07 +00:00
baldurk bcb08c1948 Treat vkCmdFillBuffer the same as e.g. vkCmdClear*Image, as a draw
* We also add 'Clear' usage to the buffer for these events.
2020-01-27 20:45:07 +00:00
baldurk ce7f3c0fa4 Ensure we correctly patch-up resource usage after indirect count draws 2020-01-27 20:45:07 +00:00
Benson Joeris a03499d909 Add SEPARATE_DEPTH_STENCIL_LAYOUTS support in new image state
Change-Id: I54458143cd075c0239f55ccb7e50916d725188ec
2020-01-27 20:44:54 +00:00
Benson Joeris cb66100840 Add new image tracking to replay side
Change-Id: I67ef6b1f6fd9b84621ec6700a8260c24afb35a05
2020-01-27 20:44:54 +00:00
Benson Joeris 1d44386724 Add new image tracking to capture side
One notable high-level change is the behaviour of `StartFrameCapture`.
The previous implementation serialised the image state when
`StartFrameCapture` was called. The new implementation just sets the
"old" (beginnin go frame) image state (layouts/queue families) to be the
current state at this point; at `EndFrameCapture` the full image state
is serialised, including both the "old" (beginning of frame) and "new"
(end of frame).

Change-Id: I04c18c16a97e065c7a7d0edf058ba3f4803dcf45
2020-01-27 20:44:54 +00:00
Benson Joeris 888abc6a55 Added ImageState serialization
Change-Id: I87b2bc26bf1fc7d56b464ad2d67b6dbdc0c72ff6
2020-01-27 20:44:54 +00:00
Benson Joeris c55937ffbf Add LockingImageState
Change-Id: I8f1adc8617295d4a86067908ce8df85ea04e8365
2020-01-27 20:44:54 +00:00
Benson Joeris 96bbeea4a5 Add ImageState
`ImageState` tracks the state of images and their subresources.
This functionality was previously split between the `ImageLayouts` and
`ImgRefs` classes.

Change-Id: I3242417dacf73fe07765f9bcfd449599e373e10d
2020-01-27 20:44:54 +00:00
Benson Joeris 3d90609e39 Add ImageBarrierSequence
`ImageBarrierSequence` represents a sequence of batches of
`VkImageMemoryBarrier`s. The intended use case is setting image state,
which may involve a combination of layout transitions and queue family
transfers, and may require multiple barriers executed on different
queue families, in the correct order.

It is moderately expensive to execute a sequence of separate queue
submissions, with synchronization to prevent overlapping execution.
`ImageBarrierSequence` attempts to address this in two ways:
- `ImageBarrierSequence::Merge` allows separate barrier sequences (e.g.
  on separate images) to be merged, so that, e.g. the first batches from
  each of the barrier sequences are all run together.
- `InlineSetupImageBarriers`/`InlineCleanupImageBarriers` allow barriers
  to be inlined into an existing command buffer, when possible. E.g.
  to read the contents of an image, the barrier sequence may simply have
  a layout transition to `TRANSFER_SRC_OPTIMAL` (assuming the image is
  already on the correct queue family), and this can be inlined into the
  command buffer before executing the copy, avoiding the need for an
  extra queue submission.

Change-Id: I7f2edc650d9ff66871c9be5711789bfe33ca8c5e
2020-01-27 20:44:54 +00:00
Benson Joeris c84fcc2aae Add last present queue and semaphores to swapchain info
This is used for queue family tracking of presented images.

Change-Id: I64ac88a8e4b379bd947f56f5cf2c1db929e8c620
2020-01-27 20:44:54 +00:00
Benson Joeris 8ccff3de48 Make queue family available in vkCmd* functions
This allows much simpler analysis of queue families. E.g. in
`vkCmdPipelineBarrier`, we can differentiate between queue family
release and acquire operations; we can also mark used subresources as
implicitly acquired by the command buffer's queue family.

Change-Id: I3e90ea1be5938781bdec675e69918b5f2bc49a49
2020-01-27 20:44:54 +00:00
Benson Joeris e7303660d7 Add additional fields to ImageInfo
Three new fields are added to `ImageInfo`
- `VkImageType imageType`: this is used to distinguish 2D and 3D images,
  to correctly handle access through 2D image views.
- `VkImageLayout initialLayout`: this is the `initialLayout` in which
  the image was created (`UNDEFINED` or `PREINITIALIZED`). This is used
  to correctly initialize `PREINITIALIZED` images (See: TODO).
- `VkSharingMode sharingMode`: This is needed to correctly generate
  queue family transfers, because we must *not* generate queue family
  transfers for images with `CONCURRENT` sharing mode.

This also refactors `SwapchainInfo` to use `ImageInfo`, rather than
duplicating some of `ImageInfo`s fields.

Change-Id: Ic42077c382e4055cb27af069045c46eacbd122cc
2020-01-27 20:44:54 +00:00
Benson Joeris 687f12f492 Add ImageSubresourceRange
`ImageSubresourceRange` is a common representation of subresource
ranges of Vulkan images, including `VkImageSubresourceRange` and
`VkImageSubresourceLayers`.

Additionally, `ImageSubresourceRange` can represent a range of depth
slices--this is used to model access to 3D `VkImage`s through 2D
`VkImageView`s, where the view array layers are mapped to the image's
depth slices.

Change-Id: Id08329b499a02817ccd3487bdbb9c1bb0f86262a
2020-01-27 20:44:54 +00:00
Benson Joeris 35a15cf8d1 Add Unknown FrameRefType
This represents a (sub)resource for which no usage info is available.
It should be conservatively assumed that such a resource needs to be
re-initialized before each replay (and this behaviour is reflected in
`InitReq()`).

Change-Id: I12235a6cb1c4b2e3e21bed8834653ec6a3aea009
2020-01-27 20:44:54 +00:00
baldurk ecd108c6c3 Fix handling promotion of extensions
* An extension can be promoted but behind an optional feature bit
2020-01-24 12:37:30 +00:00
baldurk 3523d1ef15 Make sure to set correct buffer device address flag on memory for KHR 2020-01-24 12:15:56 +00:00
baldurk 2d668e13b7 Prevent race condition if multiple threads create identical D3D12 object
* We use HasWrapper() to deduplicate D3D12 objects which must not be created as
  duplicates, but we need to ensure that checking for existing wrappers and
  adding a new one all happens atomically with respect to other checks.
2020-01-23 15:51:13 +00:00
baldurk 332925d47e Handle OpLine/OpNoLine in SPIR-V disassembly 2020-01-23 15:08:02 +00:00
baldurk 0f8c9073b7 Hopefully fix handling of physical device functions in vkGet*ProcAddr 2020-01-23 12:32:04 +00:00
baldurk 4c9bb5d844 Add special push/pop logic for WGL contexts
* We can't easily restore the application's context if the DC that was current
  has been released. Instead we check to see if the last known window is still
  valid - if so, we get the DC handle from it. If not then we assume that
  rendering to the application's context setup would have failed so we bind our
  own backdoor window (but with the application's context still).
2020-01-22 19:05:53 +00:00
baldurk 14b3a06361 Add test of D3D12 ExecuteIndirect 2020-01-22 19:05:53 +00:00
baldurk a49f3f5462 Add test of degenerate vertex shaders with no outputs but full GS output 2020-01-22 19:05:53 +00:00
baldurk 9b29c5b35e Fix selection of MSAA pipeline variant on D3D12 2020-01-22 19:05:53 +00:00
baldurk d8c112dd78 Don't try to initialise texture when structured exporting on GL 2020-01-22 19:05:53 +00:00
baldurk 6c68576707 Add workaround for strange systems with difficult visualinfo setups 2020-01-22 19:05:53 +00:00