Commit Graph

9113 Commits

Author SHA1 Message Date
Benson Joeris accbca579c Vulkan: Add image subresource tracking for descriptor set records
Change-Id: Ic336b5e65435743729e85ed231ad114f556b3811
2019-06-18 15:54:23 +01:00
Benson Joeris 666e6730df Vulkan: Add image view tracking for command buffer records
Change-Id: I60718d7d7dbadd0e1ed1c8072d87f2de49282f08
2019-06-18 15:54:23 +01:00
Benson Joeris 0f8c1d3f09 Vulkan: Add image tracking for command buffer records
Change-Id: Iecac4cc07453457d289fd04788cf5eb0c2942f0c
2019-06-18 15:54:23 +01:00
Benson Joeris 16e410d310 Vulkan: Add image subresource tracking to VulkanResourceManager
Change-Id: I9e14cb8bbb98142c8b6ff194c0d989e22f040a06
2019-06-18 15:54:23 +01:00
Benson Joeris 54c5a9c303 Vulkan: Fix EndFrameCapture with null wnd
This ensures that a thumbnail is created using the image from last
presented swapchain.

This swapchain, and the thumbnail still could be null. `CreateRDC` was
incorrectly asserting that the thumbnail contained non-null data. In
fact, `CreateRDC` already behaves correctly in the case of null
thumbnail data, so this assertion is removed.

Change-Id: I5b35463898029b0130fe9d8f39dda30e192deef6
2019-06-18 11:18:05 +01:00
Benson Joeris e702598212 Vulkan: ImgRefs now uses ImageInfo.
Also added some additional `ImgRefs` tests for 3d images.

Change-Id: I36805ef5135207e691a1c27e6b4fd0903bb8a4f3
2019-06-13 18:33:03 +01:00
Benson Joeris aa62d20477 Vulkan: Make image info available through ResourceInfo
The image info (layerCount, levelCount, sampleCount, extent, format,
type)  was previously only available through `ImageLayouts`. This info
is now also stored in `ResourceInfo`.

Storing this in `ResourceInfo` makes this info easily accessible from
`VkResourceRecord`s representing `VkImage`s and `VkImageView`s. This
simplifies upcoming changes to the image tracking and avoids the lock
protecting the `m_ImageLayouts` map.

To simplify this duplication, a new struct `ImageInfo` is added here to
hold the image info in both `ResourceInfo` and `ImageLayouts`.

Change-Id: I390cbba4c3ce7b0bd6f004521497c21bf4c1e97f
2019-06-13 18:33:03 +01:00
Benson Joeris e66acc5429 VkResourceRecord::resInfo presence no longer indicates sparse bindings
This VkResourceRecord::resInfo being non-null was previously used as an
indicator that VkBuffer or VkImage resources had sparse bindings. Now,
`resInfo->IsSparse()` must also be true for the resource to be
considered as having sparse bindings.

Change-Id: Ia8a93ecb3248a682f71fcf6455d0d583ca129679
2019-06-13 18:33:03 +01:00
baldurk 5556eb3c93 Add missing serialise instantiation 2019-06-13 18:31:28 +01:00
baldurk 16985b8098 Allow unknown GUIDs to be queried via EnumAdapter* calls 2019-06-13 14:01:52 +01:00
baldurk 6adaa4dd09 Handle querying for ID3D12Pageable on interfaces that support it 2019-06-13 14:01:37 +01:00
baldurk 0bef9cb973 Do friendly stringification of vulkan API versions in serialised data
* We use a wrapper type instead of uint32_t to let us stringify it as
  VK_MAKE_VERSION
2019-06-13 10:07:20 +01:00
baldurk 88189e316f End stream-out queries in ClearState(). Closes #1412
* Also add tests of stream-out and DrawAuto()
2019-06-12 19:07:22 +01:00
baldurk 48cdc00b7f Fix callback not being run for injection path. Closes #1411 2019-06-11 20:33:20 +01:00
baldurk dc93c71a1f Patch chunkIndex for vkBeginCommandBuffer event in vkCmdExecuteCommands 2019-06-10 14:39:03 +01:00
baldurk 28e4660ffe Sanitise image layouts for revert of partial renderpass layout changes 2019-06-10 14:38:23 +01:00
baldurk c155a85945 Always emulate EXT_direct_state_access on replay. Closes #1409
* Some drivers like NV are buggy with EXT_dsa functions leaking state or
  breaking objects
2019-06-10 11:39:13 +01:00
baldurk f31f9e46a4 Fix linux build 2019-06-07 19:51:27 +01:00
baldurk 3d81638d06 Fix some copyright dates still referring to 2018 2019-06-07 18:54:10 +01:00
baldurk f09c40b8c9 Fix broken cases with GL_ARB_gl_spirv. Closes #1405
* We can't rely on the driver's reflection, since name information might be
  stripped and the driver is within its rights to not reflect anything even if
  we have names. Similarly queries by names etc will not work.
* Also we can't try to change bindings that are immutable on SPIR-V shaders -
  UBO/SSBO bindings, transform feedback varyings, attrib and fragdata locations.
* Programs can't mix and match SPIR-V and GLSL, so when including our own
  shaders in the overlay program make sure they match what the user's shaders
  are.
* For mesh output, we need to patch the SPIR-V if it's a SPIR-V shader instead
  of trying to use the GL XFB varyings set.
2019-06-07 18:53:02 +01:00
baldurk 48d854365d Move AddXFBAnnotations into common SPIR-V code so it can be shared 2019-06-07 18:45:57 +01:00
baldurk c15693d149 Generate fixedcol and quadwrite overlay shaders in SPIR-V on GL
* Only when the extension is supported - otherwise we won't need it
2019-06-07 18:45:27 +01:00
baldurk 28cde37849 Add support for generating SPIR-V shaders for OpenGL
* Only a couple of these are needed - ones we might link with user shaders in a
  program
2019-06-07 18:44:13 +01:00
baldurk 9e09de40ce Fix analytics tracking of capture features
* We want these flags to be 'sticky', not to be unset if they aren't used in a
  capture.
2019-06-06 17:39:14 +01:00
baldurk f58f5dd406 Fix double-delete of GL program. Refs #1406 2019-06-06 13:11:59 +01:00
baldurk 7c6921248f Exit on compile error on travis OSX build 2019-06-05 19:03:57 +01:00
baldurk c082a3ca7d Fix apple build 2019-06-05 19:01:42 +01:00
baldurk 70007d0794 Don't consider interim position builtins to be projected/rasterized
* Even if the VS outputs to the position builtin, if there's a tessellation or
  geometry shader consuming it that doesn't mean much.
2019-06-05 17:57:28 +01:00
baldurk 700b100dc5 Add /usr/local/lib to macOS vulkan search path attempts 2019-06-05 17:57:28 +01:00
baldurk 257e78dbff Return dummy do-nothing IDXGIInfoQueue, the same as ID3D11InfoQueue 2019-06-05 17:57:27 +01:00
baldurk 63386cb765 Add extra check to not try to delete shader/program 0. Closes #1406
* The GL spec says that this is clearly allowed, but some buggy Android drivers
  throw warnings or errors so we can add this harmless check on shutdown.
2019-06-05 17:52:56 +01:00
Benson Joeris be2a6549dd Vulkan: Add ImgRefs to track usage of image subresorces
Change-Id: I7f111fb8aa4e1296315a8c852830205cf51f05e5
2019-06-05 09:52:33 -07:00
baldurk 217506869f Only patch vulkan image layouts at the last second
* Instead of patching e.g. PRESENT to GENERAL early, we keep the 'real' layout
  even if that's UNDEFINED or PRESENT or whatever. We then do a last-second
  patchup whenever we're actually transitioning images in vulkan itself, to set
  the right layout.
* This requires us to do the patching in a few more places - anywhere like
  texture rendering or initial states where we want to go from current state ->
  custom state -> back to current state.
* This also allows us to more gracefully handle PREINITIALIZED image layouts. We
  internally promote them to GENERAL as soon as possible, but keep them around
  as PREINITIALIZED for display.
2019-06-04 18:18:10 +01:00
baldurk bbcf97efa2 Use nonCoherentAtomSize as an additional alignment for Vulkan buffers
* This isn't technically true but it makes the code much simpler to align
  offsets and sizes to it, so that then map flushes and invalidates all happen
  on multiples of the atom size.
2019-06-04 18:18:10 +01:00
baldurk 453c5ea9fc Don't try to reset states for images with no memory bound
* Normally such images wouldn't be in the capture at all since there's no way to
  reference them until after their memory is bound, but with "Ref all resources"
  it's possible.
2019-06-04 18:18:10 +01:00
baldurk bf4ea85470 Skip descriptorCount == 0 bindings when applying initial state
* This could cause memory corruption if the final binding(s) were so empty as we
  write off the end of the array before eventually skipping.
2019-06-04 18:18:10 +01:00
baldurk 776b9d048f Lock around mangement of D3D12 resource maps 2019-06-04 18:18:10 +01:00
baldurk 4738844122 Allow choosing activities for an android program. Closes #1387 2019-06-04 18:18:09 +01:00
ruslan_kutdusov e8e3972953 Fix error in D3D11DebugManager::CopyArrayToTex2DMS
* There was an error in case of depth copy. Before the first draw only
  registers t1-t9 are cleared, but shader also expects 2D Array SRVs on t11
2019-06-04 10:17:55 -07:00
ruslan_kutdusov 5291a9c19d Fix error in D3D11DebugManager::CopyTex2DMSToArray
* There was an error in case of depth copy. Before the first draw only first
  8 registers are cleared, but shader also expects 2D MS SRVs on t11-t15
2019-06-04 10:17:55 -07:00
baldurk 9c8018ba18 Fix linux build 2019-06-03 15:32:17 +01:00
baldurk 0842e50cb1 Don't transition to UNDEFINED if undoing implicit barriers. Closes #1394 2019-06-03 14:16:43 +01:00
baldurk 1fd75c50f8 Disallow implicit casts to/from SPIR-V Id
* This can lead to bugs, so instead we should be explicit about what is an ID
  and what is a uint
2019-06-03 14:16:43 +01:00
baldurk 587d562fa3 Fix NaN and INF value comparisons in tests 2019-06-03 14:16:43 +01:00
baldurk d4e7a0633c Move SPIRVId/SPIRVIterator/SPIRVOperation to common header
* We also add an rdcspv namespace, which we'll be generating our own enums etc
  to replace the spirv.hpp spv namespace.
2019-06-03 14:16:43 +01:00
baldurk c3d5924f0d Remove unnecessary includes in Intel GL counters project 2019-06-03 14:16:42 +01:00
baldurk a27234c28c Split apart some of the SPIR-V headers
* We don't want to have glslang specific bits mixed in with general SPIR-V bits.
  This is also preparing for moving some SPIR-V structs into common code that
  can be re-used in new reflection/disassembly as well as editing.
2019-06-03 14:16:42 +01:00
baldurk 312b448f72 Convert tabs to 4-spaces 2019-06-03 14:16:42 +01:00
Benson Joeris 7f955daa40 Add BitFlagIterator to iterate over bits
Change-Id: I201eaa36ab50b42e32aa06976d34c1c070b8a3c4
2019-05-31 07:26:43 -07:00
Benson Joeris 08f9a93574 Vulkan: Add ImageLayouts::imageType
The image type is required to correctly handle 3D images accessed through 2D
views

Change-Id: I18364584413d83c186535f1091226c00d2bbf018
2019-05-31 02:26:37 -07:00