Commit Graph

601 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen ce45297695 vkd3d: Enable debug_utils if vk_debug is enabled.
Allows debug callbacks to go through in Wine.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-03-08 16:40:51 +01:00
Hans-Kristian Arntzen 9a63df07b8 vkd3d: Add punchthrough path for descriptor copies.
Proves out the viability of this style of implementation. Ideally we'd
have a more officially sanctioned way of doing similar things later :)

Unfortunately, the overhead removal is too great to ignore on target
platform. Makes use of a private (reserved) extension for now ...

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-03-04 13:34:18 +01:00
Hans-Kristian Arntzen dc622fc715 vkd3d: Recycle command pools in Elden Ring.
Very churny.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-25 18:40:52 +01:00
Hans-Kristian Arntzen 9817c52d24 vkd3d: Add workaround to ignore mismatch driver/device in PSO library.
Elden Ring does not detect the proper error code and create a new
pipeline library. Instead, create a fresh new library, which works
around the issue.

The game has a pattern of LoadPipeline -> if fail -> CreatePSO ->
StorePipeline. Sometimes, in the same process it will LoadLibrary from
its own cache (could explain some stutters),
so it's very useful to have this either way.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-25 14:50:57 +01:00
Hans-Kristian Arntzen f39ece9a7c vkd3d: Enable performance workarounds for Elden Ring.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-25 13:59:08 +01:00
Hans-Kristian Arntzen c19eaac376 vkd3d: Add VKD3D_CONFIG option for command pool recycling.
Normal behaving apps should not benefit from any of this.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-25 13:59:08 +01:00
Hans-Kristian Arntzen 54fbadcc94 vkd3d: Recycle command pools.
Elden Ring in particular spam frees and allocates command pools despite
this being a very bad idea.

Add a simple 8-entry cache which seems to take care of it.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-25 13:59:08 +01:00
Hans-Kristian Arntzen 84d632f194 vkd3d: Rewrite memory layout for resource descriptors.
Tune memory layout so that we can deduce various information without
making a single pointer dereference:

- d3d12_descriptor_heap*
- heap offset
- Pointer to various side data structures we need to keep around.

Instead of having one big 64 byte data structure with tons of padding,
tune it down to 32 + 8 bytes per descriptor of extra dummy data.

To make all of this work, use a somewhat clever encoding scheme for CPU
VA where lower bits store number of active bits used to encode
descriptor offset. From there, we can mask away bits to recover
d3d12_descriptor_heap. Metadata is stored inline in one big allocation,
and we can just offset from there based on extracted log2i_ceil(descriptor count).

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-25 13:04:43 +01:00
Hans-Kristian Arntzen b309913b6d vkd3d: Use unsafe_impl in CopyDescriptorsSimple.
This is an ultra-hot path and seems to show up somehow on profile.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-25 13:04:43 +01:00
Hans-Kristian Arntzen c29d005ef4 vkd3d: Don't enable fast descriptor copy path for descriptor QA.
The hooks are in the generic function.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-24 16:42:00 +01:00
Hans-Kristian Arntzen 8a46c21254 vkd3d: Add VKD3D_CONFIG to skip memory allocator clears.
For cases where games spam committed allocations and don't use
NOT_ZEROED. We still rely on zerovram behavior for initial backing which
should be enough in most cases.

Strictly speaking however, we are forced to clear the allocations every
time if application does not use the flag correctly.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-24 12:52:05 +01:00
Hans-Kristian Arntzen edbf49aad4 vkd3d: Support opt-in to single MUTABLE set.
Useful for Intel since Intel hardware cannot support more than 1M
descriptors in general, and opting in to correct behavior should improve
CPU overhead as well when copying descriptors.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-21 17:08:25 +01:00
Hans-Kristian Arntzen 15704b2419 vkd3d: Optimize descriptor copies for common code paths.
The common path that we really need to optimize for is CBV_SRV_UAV +
Simple + 1 descriptor.

Descriptor benchmark shows an almost 50% reduction in overhead now.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-21 16:35:36 +01:00
Hans-Kristian Arntzen 2f6a91e772 vkd3d: De-virtualize query for descriptor size.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-21 16:35:36 +01:00
Hans-Kristian Arntzen 33f17cc74d vkd3d: Add VK_EXT_pipeline_creation_feedback.
Useful when used together with pipeline library logging. Confirms that
we can load pipeline caches as expected.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-04 14:31:34 +01:00
Hans-Kristian Arntzen 47337d5e0b vkd3d: Add VKD3D_CONFIG flags for various pipeline library logging.
Additionally, add option to ignore cached SPIR-V.
Will be useful for debugging, and also required for VKD3D_SHADER_OVERRIDE.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-04 14:31:34 +01:00
Hans-Kristian Arntzen f03940ef4b vkd3d: Add global_pipeline_cache option.
Avoids saving out pipeline cache blobs which are likely going to be
cached by on-disk cache anyways.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-04 14:31:34 +01:00
Hans-Kristian Arntzen 29d956c6c4 vkd3d: Fix memory leak of D3D12 device singleton.
Fairly trivial, caught by ASAN.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-02-02 13:56:36 +01:00
Philip Rebohle 8f81aaa710 vkd3d: Fix reporting of WriteBufferImmediateSupportFlags.
Oversight from when we added bundles.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2022-02-01 16:21:43 +01:00
Hans-Kristian Arntzen 86f8f41490 vkd3d: Compute a global shader interface key for a D3D12 device.
This key represents the variations of SPIR-V which would be generated
from otherwise identical inputs like DXBC blobs and root signatures.

Typically, changing VKD3D_CONFIG flags or enabled extensions will affect
this key. This ensures that we will not attempt to use a cached SPIR-V
file unless we can trust that the SPIR-V interface will match.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-01-25 14:07:07 +01:00
Hans-Kristian Arntzen e90b573896 vkd3d-shader: Use flag for vkd3d_shader_meta bools.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-01-25 14:07:07 +01:00
Philip Rebohle 1af62abfe7 vkd3d: Enable quirk for further UE4 shaders.
Fixes artifacts in The Ascent.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2022-01-19 16:49:42 +01:00
Hans-Kristian Arntzen 6cba8b9945 vkd3d: Workaround broken barriers in DEATHLOOP.
In DEATHLOOP, there is a render pass which renders out a simple image,
which is then directly followed by a compute dispatch, reading that
image. The image is still in RENDER_TARGET state, and color buffers are
*not* flushed properly on at least RADV, manifesting as a very
distracting glitch pattern. This is a game bug, but for the time being,
we have to workaround it, *sigh*.

For a simple workaround, we can detect patterns where we see these
events in succession:

- Color RT is started
- StateBefore == RENDER_TARGET is not observed
- Dispatch()

In particular, when entering the options menu, highly distracting
glitches are observed in the background.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2022-01-12 12:20:03 +01:00
Samuel Pitoiset f6fe3e0183 vkd3d: Require VK_KHR_copy_commands2
This extension is trivial to implement for vendors and should be
widely supported.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2022-01-12 12:06:06 +01:00
Samuel Pitoiset b42a7193fc vkd3d: Require VK_KHR_bind_memory2
This extension is trivial to implement for vendors and should be
widely supported.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2022-01-12 12:06:06 +01:00
Hans-Kristian Arntzen 459cae5673 vkd3d: Fix redundant return from void.
Fix MSVC warning.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-12-02 22:48:48 +01:00
Arkadiusz Hiler 93d105adae vkd3d: Retry to create Vk device without NVX extensions.
The creation with those extensions may fail in few cases:
 * older 32 bit drivers
 * missing or inaccessible /dev/nvidia-uvm

There's also a mysterious crash that some Debian users experience with
64bit titles and a correct /dev/nvidia-uvm.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
2021-12-02 12:44:37 +01:00
Georg Lehmann 4240ab7559 vkd3d: Allow B8G8R8A8 UAVs.
This is now allowed according to
https://microsoft.github.io/DirectX-Specs/d3d/RelaxedCasting.html

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-11-24 15:15:14 +01:00
Philip Rebohle b03c1fcb5f vkd3d: Implement ID3D12Device9.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-11-19 14:57:51 +01:00
Philip Rebohle 3b6a4ab988 vkd3d: Implement ID3D12Device8 and ID3D12Resource2.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-11-19 14:57:51 +01:00
Philip Rebohle d61f562a3e vkd3d: Implement ID3D12Device7.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-11-19 14:57:51 +01:00
Joshua Ashton 046524f2a1 vkd3d: Implement MinLODClamp using VK_EXT_image_view_min_lod
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-11-17 20:51:20 +01:00
Robin Kertels 19a1dce393 vkd3d: Set GetCopyableFootprints total_bytes late.
Halo Infinite uses &desc->Width for total_bytes.
We can't set total_bytes early because code after this relies on desc->Width.

Signed-off-by: Robin Kertels <robin.kertels@gmail.com>
2021-11-16 11:53:18 +01:00
Hans-Kristian Arntzen 45ae742526 vkd3d: Pretend that SSBO alignment on NV is 4 bytes.
The 16-byte requirement is kind of a lie. The real requirement is tied
to how vectorized load-store instructions are emitted in the shader
itself since I guess it allows compiler to assume something about
alignment of the base pointer.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-09 14:47:10 +01:00
Hans-Kristian Arntzen b53a4a98a6 vkd3d: Enable per component robustness on AMD.
Tested and verified to work as expected, not so much on NV.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-09 14:47:10 +01:00
Hans-Kristian Arntzen 3210832ad9 vkd3d: Enable VK_EXT_scalar_block_layout.
dxil-spirv can take advantage of this now.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-09 14:47:10 +01:00
Hans-Kristian Arntzen 35d2f1e87f vkd3d: Correctly check for SM 6.6 required features.
Remove the experimental flag and unconditionally enable SM 6.6 if
available.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-01 14:20:38 +01:00
Hans-Kristian Arntzen 2b11c70129 vkd3d: Hook up WaveSize implementation.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-01 14:20:38 +01:00
Hans-Kristian Arntzen 7cc435c0bc vkd3d: Enable feature bits for 64-bit atomics.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-01 14:20:38 +01:00
Hans-Kristian Arntzen de64ebd1d1 vkd3d: Expose Int64 feature.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-01 14:20:38 +01:00
Hans-Kristian Arntzen 23ad0247e3 vkd3d: Enable 64-bit atomics extensions.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-01 14:20:38 +01:00
Hans-Kristian Arntzen 6255eaec32 vkd3d: Stub out the more recent FEATURE_DATA structs.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-11-01 14:20:38 +01:00
Hans-Kristian Arntzen 85c75a042f vkd3d: Enable VK_NV_compute_shader_derivatives.
Supported on more implementations too :)

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-27 17:00:33 +02:00
Georg Lehmann eb48213bfa vkd3d: Follow the new shaderStorageImage{Read, Write}WithoutFormat rules.
The Vulkan spec update 1.2.195 restricted these features to a very limited
format subset, and somehow this is supposed to not be an API break?
Anyway, let's follow the new rules.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-10-27 17:00:21 +02:00
Georg Lehmann fd690e3831 vkd3d: Enable typed uav loads based on KHR_format_feature_flags2.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-10-27 17:00:21 +02:00
Georg Lehmann 07d53a82cc vkd3d: Init shader extensions later.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-10-27 17:00:21 +02:00
Georg Lehmann 4c37b4c341 vkd3d: Use vkGetPhysicalDeviceFormatProperties2.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-10-27 17:00:21 +02:00
Georg Lehmann c8d633cb51 vkd3d: Enable VK_KHR_format_feature_flags2.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-10-27 17:00:21 +02:00
Hans-Kristian Arntzen 6548e4fd00 vkd3d: Add VKD3D_CONFIG for experimentally enabling SM 6.6.
To be used for bringup and removed when we complete the support.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-26 15:32:36 +02:00
Hans-Kristian Arntzen 740e23ea8a vkd3d: Add VKD3D_CONFIG to force non-invariant position.
It's common enough that new games break on RDNA2 because of this that we
should enable this by default. This matches DXVK behavior.

SOTTR gets a special weird exception, just like DXVK. The shaders are
broken enough that the proper fix is actually precise, not invariant.
This will be addressed at some later point.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-18 15:51:20 +02:00
Hans-Kristian Arntzen be8d6ec7ad vkd3d: Make global quirks info struct a value.
Allows us to fiddle with it after the fact.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-18 15:51:20 +02:00
Hans-Kristian Arntzen 8beb7dde89 vkd3d: Handle NULL pointers in GetResourceTiling in more places.
DEATHLOOP uses all NULL at some point ...

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-15 15:12:41 +02:00
Hans-Kristian Arntzen 0c60791bb1 vkd3d: Pass down PrimitiveCulling extension to vkd3d-shader.
DXR 1.1 only feature.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-12 16:04:30 +02:00
Hans-Kristian Arntzen 6866b45637 vkd3d: Add CONFIG flag for enabling DXR 1.1.
We cannot support ExecuteIndirect with TraceRays() for time being.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-12 16:04:30 +02:00
Hans-Kristian Arntzen 99365bcaec vkd3d: Enable VK_NV_fragment_shader_barycentric.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-11 13:53:19 +01:00
Hans-Kristian Arntzen 1e42acf492 vkd3d: Allow BUILD_MODE_UPDATE in PrebuildInfo check.
Metro Exodus Enhanced Edition hits this a lot.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-08 07:21:47 +01:00
Hans-Kristian Arntzen 0f2e448659 vkd3d: Handle CreatePipelineLibrary with NULL ppData.
Supposed to return S_FALSE.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-07 17:55:57 +02:00
Hans-Kristian Arntzen ab4e847e74 renderdoc: Add global capture support.
Useful for test suite since a test can be comprised of several smaller
submissions, and it's easier to debug if we have one trace.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-07 15:33:06 +02:00
Joshua Ashton c9ff20d4ac vkd3d: Make a generic UE4 shader quirk collection
Many UE4 games have this broken bloom shader that samples a texture with implicit lod in divergent control flow.

Fixes Bus Simulator 21

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-07 10:18:47 +01:00
Joshua Ashton 7a66669e92 vkd3d: Add empty element to shader quirks
If we ever remove these, we need this for MSVC.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-07 10:18:47 +01:00
Joshua Ashton d91d47d827 vkd3d: Use vkd3d_string_compare for shader quirks
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-07 10:18:47 +01:00
Joshua Ashton 70ee02bce0 vkd3d: Use vkd3d_string_compare for application overrides
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-07 10:18:47 +01:00
Hans-Kristian Arntzen cd3d759b95 vkd3d: Enable VK_KHR_shader_integer_dot_product.
Accelerates SM 6.4 packed ops if present.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-10-05 15:38:59 +02:00
Hans-Kristian Arntzen 0c2ddb89cd vkd3d: Add CONFIG for forced CACHED memory.
Very useful for capturing. Speeds up a ton.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-27 14:48:26 +02:00
Joshua Ashton cabc31fc4c vkd3d: Move ID3D12Device impl_froms to header
Basic casts should not be function calls.
2021-09-23 12:12:13 +02:00
Joshua Ashton 8d5308c9a1 vkd3d: Move ID3D12Resource impl_froms to header
Basic casts should not be function calls.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-09-23 12:12:13 +02:00
Joshua Ashton 27e66b5c4a vkd3d: Move ID3D12Heap impl_froms to header
Basic casts should not be function calls.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-09-23 12:12:13 +02:00
Hans-Kristian Arntzen 173b8ecef0 vkd3d: Add workaround for DEATHLOOP.
Game attempts to create a host visible resource with
ALLOW_RENDER_TARGET flag. We cannot make this work on NVIDIA, but the
game never seems to actually create an RTV, so as a workaround, nop out
the flag, which does make it work after all :3

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-17 14:21:09 +02:00
Hans-Kristian Arntzen a8f623e60d vkd3d: Negate upload_hvv config.
Enable resizable BAR style allocations by default, and add option to
disable it.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-16 16:10:57 +02:00
Hans-Kristian Arntzen 12066a2b67 vkd3d: Add debug config to log resizable BAR allocations.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-16 16:10:57 +02:00
Hans-Kristian Arntzen abdaeb136d vkd3d: Add a memory budget per memory type.
For resizable BAR, we don't want to endlessly promote UPLOAD heaps to
BAR since VRAM is precious. The aim is to set a fixed budget where we
can keep allocating until full, at which point we fall back to plain HOST.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-16 16:10:57 +02:00
Hans-Kristian Arntzen 41295eff6c vkd3d: Consider CPU availibility when selecting memory types.
Need to consider that based on host visibility requirements, we need to
select either LINEAR or OPTIMAL image types, and those tiling modes can
have different memory requirements.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-16 15:35:57 +02:00
Joshua Ashton 9c0fa91ca5 vkd3d: Add shader quirks for Psychonauts 2
Works around a game bug. It uses texture() inside divergent control flow.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-09-15 11:52:39 +02:00
Hans-Kristian Arntzen 0e216b2b10 vkd3d: Narrow workaround for global pipeline cache.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-08 18:37:55 +02:00
Hans-Kristian Arntzen 11086a94e0 vkd3d: Add macros to parse/build NV driver versions.
The bit offsets are a bit different from Vulkan API.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-08 18:37:55 +02:00
Hans-Kristian Arntzen 403d1f9743 vkd3d: Workaround huge memory overhead for individual VkPipelineCaches.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-07 13:21:54 +02:00
Hans-Kristian Arntzen b54a1a6c2b vkd3d: Fix MSVC build.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 16:56:39 +02:00
Hans-Kristian Arntzen 7b67de7d0e vkd3d: Generalize get_plane_footprints.
Get information directly from vkd3d_format and allow for subsampled
formats in the future.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
Hans-Kristian Arntzen 3d5010555e vkd3d: Add d3d12_resource_desc_get_sub_resource_count.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
Hans-Kristian Arntzen 5c2376faf5 vkd3d: Handle multiplanar formats in GetCopyableFootprints.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-09-02 12:21:22 +02:00
rochaudhari 0828aec4f6 vkd3d: Implement new interfaces required for DX12 DLSS support.
Adds ID3D12GraphicsCommandListExt and ID3D12DeviceExt interfaces.

Signed-off-by: Roshan Chaudhari <rochaudhari@nvidia.com>
2021-08-27 11:37:15 +02:00
Joshua Ashton 1b957a1f74 vkd3d: Add config to use host-visible vram for UPLOAD heap
Adds the "upload_hvv" config flag, which will make D3D12_HEAP_TYPE_UPLOAD attempt to use host-visible VRAM for allocations.

This takes advantage of large or resizable BAR if available.

I see a perf delta of 83-84 -> 92-94 (~12%) when using this in Horizon Zero Dawn.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-08-23 13:24:43 +02:00
Hans-Kristian Arntzen b2c99b035a vkd3d: Allow SM 6.2 on NV.
FloatControlProperties struct appears to be broken, and it does seem to
work just fine.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-30 15:19:35 +00:00
Hans-Kristian Arntzen 093a8c49f3 vkd3d: Expose shader model 6.5.
WaveMatch and WaveMultiPrefix are implemented and pass test.
Other features are gated behind feature bits.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-29 20:42:32 +02:00
Hans-Kristian Arntzen 435a087047 vkd3d: Rework how shader model versions are exposed.
From native testing, we can expose higher shader models if
cap bits features are not supported. E.g. Polaris exposes SM 6.5, even
when 16-bit and barycentrics are not supported.

With latest dxil-spirv updates we can support the required SM 6.4
features.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 5b013d0b02 vkd3d: Validate shader meta against features.
We're supposed to validate and fail compilation if certain features are
not supported.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen ab9e99cbfa vkd3d: Check for Int16 capability as well as extended subgroup types when exposing 16-bit ops.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-28 15:28:19 +02:00
Hans-Kristian Arntzen 398724cd6e vkd3d: Require VK_KHR_separate_depth_stencil_layouts.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-02 15:18:16 +02:00
Hans-Kristian Arntzen 419790ac77 vkd3d: Add wave size workaround for GravityMark.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-07-02 15:15:42 +02:00
rochaudhari be2362268c vkd3d: Return format2 information for d3d12_device_CheckFeatureSupport
Currently only format1 information is being returned for D3D12_FORMAT_SUPPORT.

Signed-off-by: Roshan Chaudhari <rochaudhari@nvidia.com>
2021-07-02 14:07:39 +02:00
Hans-Kristian Arntzen c1860a1ead vkd3d: Add VKD3D_CONFIG flags for forcing EXCLUSIVE queue modes.
Helps in some cases, but we cannot do this by default :(

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-06-29 12:24:24 +02:00
Hans-Kristian Arntzen 7c80c92304 vkd3d: Use ALLOW_VARYING_SUBGROUP_SIZE flag as appropriate.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-06-25 15:08:53 +02:00
Georg Lehmann a7922a7c85 vkd3d: Introduce vkd3d_internal_get_vk_format.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
2021-06-24 12:55:17 +02:00
Hans-Kristian Arntzen 1ea31701c5 vkd3d: Move F1 2020 workaround over to quirks system.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-06-17 16:42:14 +02:00
Hans-Kristian Arntzen 28c8a595fa vkd3d: Pass down shader quirks for Necromunda.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-06-17 16:42:14 +02:00
Philip Rebohle b97a012787 vkd3d: Enable tiled resources tier 3.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-06-14 15:53:33 +02:00
Hans-Kristian Arntzen 42fb018d85 vkd3d: Fix leak of command pools on device destruction.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-06-11 15:17:45 +02:00
Hans-Kristian Arntzen 76a8914d6b vkd3d: Add validation error workaround.
Our internal copy shaders are fine, but we get benign errors about
sample count being wrong since we alias descriptors.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-06-10 14:19:04 +02:00
rochaudhari 1699743c37 vkd3d: Enable binary import and image view handle extensions
Signed-off-by: Roshan Chaudhari <rochaudhari@nvidia.com>

Reviewed-by: Liam Middlebrook <lmiddlebrook@nvidia.com>
2021-06-10 11:26:34 +02:00
Hans-Kristian Arntzen 3c7f188863 vkd3d: Nuke code paths for !nullDescriptor.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2021-05-27 10:39:22 +02:00