Commit Graph

9155 Commits

Author SHA1 Message Date
baldurk f2b9eef970 Add support for VK_KHR_uniform_buffer_standard_layout 2019-06-28 14:32:07 +01:00
baldurk fcd31fb949 Update to vulkan headers 1.1.112, and use own generated dispatch tables
* This removes the dependency on vk_layer_dispatch_table.h which makes it easier
  to update the vulkan headers in future.
2019-06-28 14:09:20 +01:00
baldurk f672db4a2b Add our own generated replacement for vk_layer_dispatch_table.h
* This way we only depend on vk.xml and the vulkan headers directly, not on this
  SDK/Vulkan-Loader generated file.
2019-06-28 13:39:32 +01:00
baldurk 56663ccfef Fix linux build 2019-06-28 11:43:19 +01:00
baldurk 7275934551 Add check in windows Qt project for PySide existence 2019-06-28 11:43:19 +01:00
baldurk 9780c6bb77 Add passthrough hooking of EGL 1.5 2019-06-28 11:01:27 +01:00
baldurk 7715188d0d GLES 3.1 can't handle MSAA array textures, only 3.2 can 2019-06-28 11:01:19 +01:00
baldurk 0dcedbbbcf Fix warnings on various GCC versions
* Primarily this change fixes -Wdeprecated-copy on GCC-9, but it also tidies
  warnings on other versions.
2019-06-27 11:47:45 +01:00
baldurk 9b70400eff Remove DENY_SHADER_RESOURCE flag on MSAA textures in D3D12
* We need to use MSAA textures as SRVs for copying them out in initial states.
2019-06-27 10:22:14 +01:00
baldurk ada5e55b28 Add some single-flush-validate code into D3D12 initial state preparation 2019-06-27 10:22:14 +01:00
baldurk 50266cdee2 Fix serialisation of D3D12_WRITEBUFFERIMMEDIATE_PARAMETER's gpu address 2019-06-27 10:22:13 +01:00
baldurk 24d55fde9f Don't crash in CreateUnorderedAccessView if a NULL descriptor is passed 2019-06-27 10:22:13 +01:00
baldurk 6487acdf0f Fail to capture if Create*PipelineState has no valid shader code
* This typically means that the user hasn't checked correctly for SM6 feature
  support before trying to upload DXIL shader, which will then result in
  unpredictable behaviour or crashes on replay.
* During capture we detect this and flag it in the overlay text, and prevent
  capturing. On capture load we fail to load if we detect such a PSO.
2019-06-27 10:22:13 +01:00
baldurk 039b65f89f Add a viewer of the diagnostic log in the UI itself 2019-06-27 10:22:13 +01:00
Benson Joeris 473d8a8e30 Vulkan: Optimize image barriers in Apply_InitialState
This changes the behaviour of Apply_InitialState for images with
BufferCopy type InitialState. Previously, the entire image was
transitioned to DST_OPTIMAL, along with a possible queue family
ownership transfer. Now, only the image subresources that are actually
copied/cleared are transitioned.

Change-Id: I92ab4d7160e99b81222231d1d974e707a55f7aef
2019-06-26 15:10:58 +01:00
Benson Joeris d6761de26d Vulkan: Optimize image copies in Apply_InitialState
This uses the new image tracking to avoid unnecessary copying of image
data when applying the initial state.

This change only affects image resets when all of the following apply:
  - The image initial contents tag is `BufferCopy` (not
    `ClearColorImage` or `ClearDepthStencilImage`),
  - The image is single sample,
  - The image is non-sparse,
  - The image has `ImgRefs` data,
  - The image has been completely initialized at least once, and
  - VulkanResourceManager::OptimizeInitialState() is true (currently
    disabled by default).

When all of these conditions are met, data will only be copied for those
image subresources which require reset according to the ImgRefs data.

Change-Id: I449eabfe969229fa64e233760aaadb489776ee23
2019-06-26 15:10:58 +01:00
baldurk 22203fbb02 Add checks for quad overdraw and triangle size overlays on mac
* These features aren't supported by the underlying implementation.
* Triangle size we can feature-detect properly - by checking for geometry shader
  support. Quad resolve should be supported but metal doesn't allow atomics on
  images so we have to check specifically for a metal backend.
2019-06-26 12:45:58 +01:00
baldurk 05282a3bdf Force linear images to be dirty on creation on vulkan
* This is necessary for e.g. the cube demo where it can create the image as
  LINEAR in HOST_VISIBLE memory and then the image never gets dirtied, so we
  don't properly create initial contents for it - instead only fetching the
  underlying memory which is not technically legal.
2019-06-26 12:23:44 +01:00
baldurk 2b7bcccbc6 Don't continue with vulkan postvs fetch if PSO fails to compile
* MoltenVK sometimes has problems with shader translation so we want to handle
  this gracefully if possible.
2019-06-26 11:29:18 +01:00
baldurk 88a5b4e0cf Add precise qualifiers on DXBC operations disassembly 2019-06-26 10:27:10 +01:00
baldurk ea12625193 Fix missing handling of DXGI_FORMAT_A8_UNORM 2019-06-25 20:19:37 +01:00
baldurk e525630a17 Add special resource type for A8_UNORM. Closes #1426
* While it's redundant this format is still valid in D3D so needs to be handled
  correctly.
2019-06-25 19:08:07 +01:00
baldurk 8fb0a3b80e Error out of D3D12 postvs calculation if too much data is generated 2019-06-25 19:08:07 +01:00
BJ 42e0ee8a36 Fix OpenGL integer vector uniforms
Initial state was only being serialized for the first element.
2019-06-25 19:07:46 +01:00
baldurk 0d2849458b Install generic gcc/g++ packages so configure scripts can find them 2019-06-25 10:55:48 +01:00
baldurk a90ec1ecbf Fix Qt Creator compilation on windows 2019-06-24 14:07:41 +01:00
baldurk 433222997f Always close pipes opened for subprocess communication. Closes #1424
* We still need to close the stdout/stderr pipes even if the subprocess failed
  to launch, otherwise we leak the fds.
2019-06-24 13:52:42 +01:00
baldurk 51de7255d3 Stop static linking libstdc++ in release builds
* This seemed to cause crashes on some systems as libproxy links to libstdc++
  and can then cause symbol conflicts between the static libstdc++ and the
  system's libstdc++.
* libproxy itself cannot be statically linked, so the solution is either to
  configure Qt without libproxy and break anyone who needs proxy support, or
  stop statically linking libstdc++ and add a new dependency. At commit time
  most distributions have at least g++-5's libstdc++ in their minspec so we can
  require that - the main two that seem to fall short are Debian Jessie and
  CentOS 7. Users on those systems will have to install a newer libstdc++ or
  compile from source rather than using the binary releases.
2019-06-24 13:27:45 +01:00
baldurk 1fcac940ae Always patch functions looking for bindless descriptor access
* Even if a function isn't passed a global binding array as a parameter, we
  still need to patch it in order to find any accesses it makes directly to
  global resources just as we do in the entry point.
2019-06-24 10:21:23 +01:00
baldurk a5c909ec0c Don't try to use MSAA array textures on MoltenVK 2019-06-21 12:51:52 +01:00
Benson Joeris f44ed367d6 Vulkan: Added serialization of image subresource ref type
Change-Id: Ifae412f3b4a171148f22b11825a370b84de816ee
2019-06-21 10:14:29 +01:00
Benson Joeris f4e7231fd5 Remove ImageInfo::imageType for serialization compatibility
This field was recently added to the `ImageInfo` struct, but had not yet
been added to the `ImageInfo` serialization. Serializing this field
would unnecessarily break capture compatibility.

The `imageType` field was added to detect 3D images--depth slices of 3D
images are interpreted as array layers when accessed through a 2D image
view. This data is (almost) redundant, because 2D images must have
`extent.depth==1`, according to the Valid Usage for `VkImageCreateInfo`.
The application could create an image with
`imageType==VK_IMAGE_TYPE_3D`, but with `extent.depth==1`; we would
interpret this as a 2D image, but, since this image would have 1 array
layer and 1 depth slice, this doesn't actually cause an issue.

Change-Id: I3d53d942cbe8f240845a80f6e12a7cecfdd86967
2019-06-21 10:14:29 +01:00
baldurk 38f0d27901 Use configure_file in CMake to force rebuild if git commit changes
* We also only use GIT_COMMIT_HASH where necessary to avoid rebuilding many
  files for no reason, including splitting version.cpp out into a separate
  project as we do with VS since otherwise changing its preprocessor defines
  rebuilds the whole renderdoc project.
* At the same time, move the git hash to be internal only so we don't have to
  try to link version.cpp into other projects like renderdoccmd or qrenderdoc.
2019-06-20 19:14:14 +01:00
baldurk cfa8e7c83e Remove old unused version tagging in embedded android library 2019-06-20 19:14:14 +01:00
baldurk 4547401c61 Set DisableFastUpToDateCheck on git version project
* This means the git commit is always fetched (which is cheap anyway) and
  projects get re-built with updated git commit version info
2019-06-20 19:14:14 +01:00
Aliya Pazylbekova e21ddb4877 Set analytics APIs for remote capture file and replay
The API used was not populated for the case of remote
capture and replay.
2019-06-20 19:13:57 +01:00
baldurk 4923aa9d88 Use up to date end pointer when patching android manifest. Closes #1415 2019-06-18 15:54:38 +01:00
baldurk bd36bccd43 Synchronise properly when passing commands to capture connection thread 2019-06-18 15:54:38 +01:00
baldurk 14b8560ebb On GL don't render from empty buffers - it can crash drivers 2019-06-18 15:54:38 +01:00
baldurk 29a63245ee Don't try to create initial states for render buffers 2019-06-18 15:54:38 +01:00
baldurk 96b13075c5 Fix 32-bit compilation of autotest demos 2019-06-18 15:54:38 +01:00
Benson Joeris 71ab0c508c Vulkan: Switch commands to use new image subresource tracking
Change-Id: Ic87e341239842e4b40aa06c751540e227b643083
2019-06-18 15:54:23 +01:00
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