Commit Graph

533 Commits

Author SHA1 Message Date
Philip Rebohle d4bbd4b43e vkd3d: Add sampler state object to d3d12_device.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Philip Rebohle a09a0ed86d vkd3d: Introduce vkd3d_sampler_state.
Manages unique static samplers for now, in order to reduce duplicates.
Can be extended to also manage descriptor pools for static samplers in
the future.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-26 14:56:17 +02:00
Hans-Kristian Arntzen 0c1b49d681 vkd3d: Implement OpenExistingHeapFromAddress.
Refactors out some common code in d3d12_heap_init.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen 6e2b153235 vkd3d: Add host import to allocate_buffer_memory.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Hans-Kristian Arntzen 95b6596d75 vkd3d: Enable VK_EXT_external_memory_host.
Needed for OpenExistingHeapFromAddress and friends.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-08-25 11:48:41 +02:00
Philip Rebohle 5a9d132b20 vkd3d: Get rid of descriptor spinlocks.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle 9098221f0a vkd3d: Add sampler map to device.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle 6545cb4f7d vkd3d: Add view map to null resources.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle ff69d59fa6 vkd3d: Add view map to d3d12_resource.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle 7785c60a08 vkd3d: Add image parameter to vk_image_view_desc.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle 3c9a54cb73 vkd3d: Introduce vkd3d_buffer_view_desc.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle a056922293 vkd3d: Create separate descriptor set layout for host-only pools.
D3D12 allows much larger pools to be created for heaps that are not
shader-visible, which some games make use of. Fixes crashes on Nvidia.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle 8e4aaeff05 vkd3d: Introduce new descriptor metadata struct.
Stores info about where exactly the descriptor is stored in the
Vulkan descriptor pool, and whether we have to worry about an
additional UAV counter descriptor.

This is meant to replace all the other non-static data stored
inside d3d12_desc.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Philip Rebohle fcc0c4c163 vkd3d: Remove default null image views.
We're not using these anywhere because we need formats to be correct
for image views. Buffer views are used for root descriptors and null
UAV counters.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-08-19 12:54:56 +02:00
Hans-Kristian Arntzen 00618cb2c1 vkd3d: Load VK_LAYER_KHRONOS_validation if we enable debug mode.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-30 17:36:53 +02:00
Hans-Kristian Arntzen b47dae95e5 vkd3d: Lower MAX_DESCRIPTOR_SETS to 9.
We just removed packed set.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-30 11:58:58 +02:00
Philip Rebohle 3364758746 vkd3d: Remove volatile packed descriptor handling.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle c580866648 vkd3d: Remove packed descriptor set from root signature.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle fd249acb64 vkd3d: Remove packed descriptor set update code.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-30 11:56:24 +02:00
Philip Rebohle 3766e7e994 vkd3d: Rename BINDLESS_UAV_COUNTERS -> RAW_VA_UAV_COUNTERS.
For clarity, since we'll be moving to full bindless anyway.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle 7f36039c9c vkd3d: Update uav counter set as necessary.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle 949e38e0b3 vkd3d: Add binding for uav counter views.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-29 15:23:25 +02:00
Philip Rebohle 1af4c6c719 vkd3d: Enable VK_EXT_calibrated_timestamps if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-17 11:49:38 +02:00
Philip Rebohle b212b3fb9c vkd3d: Introduce d3d12_resource_get_vk_subresource.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-16 16:53:17 +02:00
Philip Rebohle def7cf409a vkd3d: Introduce discard mask for deferred clear operations.
Allows us to skip clears while still initializing the image.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-07-16 16:53:17 +02:00
Hans-Kristian Arntzen dd6656fbe9 vkd3d: Avoid redundant pipeline binds.
When we're using extended dynamic state, we will often end up with dummy
pipeline binds, which we should try to avoid if we can.
Also avoids having to rebind dynamic state redundantly.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 0f91099dd4 vkd3d: Refactor dynamic state to be per-pipeline.
Cleans up dynamic state such that we do not have to keep dynamic state
create infos around.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 0e9a1555c1 vkd3d: Add dynamic state information to vkd3d_pipeline_key.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen e9dcdc1308 vkd3d: Move vkd3d_pipeline_key to private header.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 6967576904 vkd3d: Statically deduce patch vertex count for HS.
Fall back when there is a mismatch, which can happen if application does
not declare inputs to hull shader (unlikely).

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 084a3e6928 vkd3d: Validate minimum vertex buffer stride when using dynamic stride.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 5ef3ebce61 vkd3d: Implement extended dynamic state.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 7139621c3f vkd3d: Add conversion for topology type to Vulkan.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 551bc54546 vkd3d: Add topology type to pipeline state.
Needed to build dynamic pipeline.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen fc0a94ad04 vkd3d: Add a common pipeline for graphics pipeline state.
When using EXT_extended_dynamic_state, we will be able to compile a
master pipeline. Only in special cases will we have to fallback.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen b52a9c46bd vkd3d: Refactor graphics pipeline creation out to separate function.
Preparation for extended dynamic state refactor.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 926f2033a9 vkd3d: Enable VK_EXT_extended_dynamic_state.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 14:29:34 +02:00
Hans-Kristian Arntzen 9425b4d438 vkd3d: Bump VKD3D_MAX_DESCRIPTORS_SETS to 9.
This can happen in the worst case where we have all bindless sets, and:

- Static samplers
- Packed descriptors (UAV counters on drivers without support for this)
- Root descriptors

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-07-14 10:08:38 +02:00
Biswapriyo Nath 41b0f5a96c vkd3d: remove redeclaration of IWineDXGISwapChainFactory
IWineDXGISwapChainFactory will be in header from vkd3d_swapchain_factory.idl

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
2020-07-11 20:33:59 +02:00
Joshua Ashton aa3b7c3b26 vkd3d: Use newer ID3D12Device funcs for COM
Fixes warnings under MSVC and MinGW.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton 9c105a78a9 vkd3d: Implement swapchain and swapchain factory
Needed for standalone D3D12.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Joshua Ashton dff27c9e9c vkd3d: Load INSTANCE_EXT procs into device table
We need these for the upcoming swapchain factory implementation
for standalone D3D12.

They're also probably good to have around in future for the
d3d12 device.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Philip Rebohle d43f70bb1b vkd3d: Enable VK_EXT_robustness2 if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-29 17:18:29 +02:00
Joshua Ashton a46fb17973 vkd3d: Make enqueued_fence_count a uint32_t
Fixes atomic usage with it.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-24 21:13:35 +02:00
Joshua Ashton 287ceb207d vkd3d: Refactor platform-specific code
This commit moves the module handling code which was previously dumped in device.c and the code to retrieve the current executable path to its own file.

This also eliminates HAVE_DECL_PROGRAM_INVOCATION_NAME from config.h

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-16 11:07:50 +02:00
Hans-Kristian Arntzen 349412f19f vkd3d: Support rewinding ID3D12Fence.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-16 11:00:08 +02:00
Joshua Ashton b9909854fe vkd3d: Make nameless unions really nameless
This makes it consistent across tests and vkd3d.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-06-15 19:59:52 +02:00
Hans-Kristian Arntzen 9534c1a345 vkd3d: Move to VK_EXT_debug_utils.
debug_marker/debug_report are both deprecated in favor of debug_utils and vkd3d was using marker in a
buggy way anways, as debug_marker requires debug_report to work, but it was
only conditionally enabled.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-11 13:02:50 +02:00
Hans-Kristian Arntzen 726356ebb1 vkd3d: Always use PDF2/PDP2 without KHR extensions.
It is core in Vulkan 1.1.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-11 13:02:50 +02:00
Hans-Kristian Arntzen d8ca2cef6d vkd3d: Serialize all queue submissions.
Gets rid of the full barrier on command buffer end.
Instead, do what D3D12 wants, which is to serialize all
ExecuteCommandLists. Simplify the existing timeline sempahore setup for
sparse queues and use it for all submissions.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-06-09 14:28:13 +02:00
Philip Rebohle bbcaeee69d vkd3d: Determine compatible memory types for different resource types.
We'll need this to more accurately select the memory type for D3D12
heaps based on which resources are allowed to be placed in it.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-08 15:09:21 +02:00
Philip Rebohle e6857939e7 vkd3d: Do not enable VK_KHR_dedicated_allocation.
Core in 1.1.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Philip Rebohle 45109686be vkd3d: Do not enable VK_KHR_maintenance3.
Core in 1.1.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Philip Rebohle 3880e61be2 vkd3d: Require Vulkan 1.1 instance.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-06-02 16:23:38 +02:00
Hans-Kristian Arntzen 7e229213f5 vkd3d: Enable SM 6.2 features.
Need float16_int8 and subgroup with extended types to implement new SM
6.2 features. For now, skip over SM 6.1 features until someone makes use
of them.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-05-27 14:33:24 +02:00
Philip Rebohle 6cbf61ca92 vkd3d: Enable VK_EXT_sampler_filter_minmax if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-12 12:13:30 +02:00
Philip Rebohle 8588b46900 vkd3d: Implement d3d12_command_list_CopyTiles.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-08 16:30:54 +02:00
Philip Rebohle 73bcd3e79d vkd3d: Create semaphores for sparse binding operations.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle 8b999c7368 vkd3d: Bind sparse metadata on resource creation if necessary.
Some sparse resource may have a metadata aspect on some drivers,
which needs to be bound before the image can be used in any way.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle e3eb3498c2 vkd3d: Implement sparse binding.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle 7836c06204 vkd3d: Add dedicated queue for sparse binding if necessary.
This will serve as a fallback if at least one queue family
does not support sparse binding.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle b08477f325 vkd3d: Store tile mappings and metadata for tiled resources.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle ba712c739c vkd3d: Add d3d12_resource_get_tiling helper.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle 20b1c4f7b3 vkd3d: Introduce flag for sparse resources.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-07 15:24:35 +02:00
Philip Rebohle e59d6c4c32 vkd3d: Clean up queue creation and management.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-06 14:48:12 +02:00
Philip Rebohle 8edfa29542 vkd3d: Move vkd3d_queue_family into header.
And get rid of the somewhat redundant VKD3D_QUEUE_MAX_FAMILY_COUNT.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-06 14:48:12 +02:00
Philip Rebohle 42b6ce82f0 vkd3d: Enable VK_EXT_custom_border_color if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-05 11:39:25 +02:00
Philip Rebohle 8e7bf8a5c3 vkd3d: Do not use VK_PIPELINE_BIND_POINT_RANGE_SIZE.
These constants were removed in Vulkan 1.2.140 headers.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-05-05 11:39:25 +02:00
Philip Rebohle 9367fd5ee8 vkd3d: Implement deferred clears.
This allows us to perform clears inside the render pass even if
the render pass hasn't been started at the time of the clear yet.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-28 16:29:11 +02:00
Philip Rebohle e6bd3cb305 vkd3d: Don't emit barriers when temporarily suspending render passes.
Fixes performance regressions introduced with the barrier rework.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 16:13:19 +02:00
Philip Rebohle 1eac9936f4 vkd3d: Transition DSV to correct layout.
Now uses the layout from the graphics pipeline.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle 0ff0423538 vkd3d: Store DSV layout with graphics pipelines.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle 608ef6e605 vkd3d: Emit layout transitions when beginning and ending a render pass.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle edb793b069 vkd3d: Infer current DSV format from DSV descriptor.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle d3128592ca vkd3d: Store RTV and DSV descriptors with command list.
We need access to the resource in order to perform render pass
layout transitions, just the view handle isn't enough.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle 76b2d2af89 vkd3d: Add layout property to texture views.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle 45001e05d4 vkd3d: Introduce d3d12_resource_pick_layout.
Lets us enforce GENERAL layout for linear tiling.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Philip Rebohle 82d384531e vkd3d: Determine common image layout from bind flags.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-27 15:40:39 +02:00
Hans-Kristian Arntzen 404cd7270b vkd3d: Fix build on standalone.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-23 12:31:48 +02:00
Hans-Kristian Arntzen 805f92a38c vkd3d: Remove dead transfer buffer code.
Obsoleted after shader copy path.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-23 12:31:48 +02:00
Philip Rebohle 889ab3520f vkd3d: Implement shader-based depth <-> color copies.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-22 18:04:29 +02:00
Philip Rebohle aa02ee02ca vkd3d: Create pipelines for shader-based image copies.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-22 18:04:29 +02:00
Philip Rebohle da95bd6eaa vkd3d: Create common objects for fullscreen GS/VS.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-22 18:04:29 +02:00
Philip Rebohle e74a48cdc6 vkd3d: Simplify meta operation API a bit.
Passing the main struct to the public functions allows us
to share common data between multiple types of operations.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-22 18:04:29 +02:00
Philip Rebohle 65f2e03dd0 vkd3d: Introduce vkd3d_get_typeless_format helper.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-22 15:18:09 +02:00
Philip Rebohle 532cb49abb vkd3d: Introduce d3d12_create_static_sampler.
It makes sense to separate this from d3d12_create_sampler since static
samplers and regular samplers differ in border color support.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-21 11:57:14 +02:00
Philip Rebohle 73410939da vkd3d: Remove NULL sampler.
Not used anywhere.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-21 11:57:14 +02:00
Philip Rebohle fcc9346e8d vkd3d: Clean up unnecessary members from d3d12_heap and d3d12_resource.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-17 17:08:13 +02:00
Hans-Kristian Arntzen 98f78f039f vkd3d: Fix linking error in vkd3d-standalone.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-17 17:03:40 +02:00
Hans-Kristian Arntzen 09af24e69b vkd3d: Avoid vkResetCommandPool if there are pending command buffers.
Works around an app-bug in SotTR, where the command pool is reset before
the command buffer completes.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-17 15:31:38 +02:00
Hans-Kristian Arntzen 334b1cab8d vkd3d: Implement threaded submission queue.
D3D12 supports out-of-order signal and wait. So does Vulkan timeline
semaphores. However, in Vulkan we don't have an infinite amount of
virtual queues. We must potentially map multiple D3D12 queues on top of
Vulkan, which might lead to a deadlock when app attempts to
wait-before-signal if the two queues are mapped to the same physical
Vulkan queue.

In order to solve this, we need to hold back submissions until we know
it is safe to do so. To make this work in practice as simply as possible, each
ID3D12CommandQueue has its own submission thread, which will block on an
ID3D12Fence's pending timeline value for a Wait command. The main reason to use a
submission thread is that resolving this directly in
ID3D12CommandQueue::Signal is extremely tricky and potentially
needs recursively locking queues and fences.

Note that we only block on the pending wait value, not the actual wait
value, so there is no real CPU <-> GPU synchronization here. In the
common case, no submission thread will block.

The added benefit is that submits are async now, so main thread CPU
overhead might slightly decrease.

To play nice with DXGI swapchain, the external entry point for acquiring
the Vulkan queue needs to drain the submission thread and lock it to ensure
submissions happen in order.

Fixes hangs in The Division 1, which makes use of this D3D12 feature.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-17 15:31:38 +02:00
Philip Rebohle 957aec4785 vkd3d: Restore old ClearUnorderedAccessView implementation.
The current code uses D3D12 abstractions to create pipelines but
issues raw Vulkan API calls to actually implement the functionality,
which means the code makes assumptions about the exact descriptor
set layout and push constant layout, which is generally a bad idea
now that we have multiple code paths for root constants etc.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-16 18:03:39 +02:00
Hans-Kristian Arntzen edc614ab2e vkd3d: Remove legacy fence/semaphore path.
Prepares for a rewrite of queue submission, the legacy path is never
run in practice and will likely break in subtle ways.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-04-16 15:31:04 +02:00
Philip Rebohle 25f0af58f6 vkd3d: Implement D3D12_FEATURE_D3D12_OPTIONS6 feature query.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 14:25:01 +02:00
Philip Rebohle 0701d87474 vkd3d: Update ID3D12CommandList to ID3D12GraphicsCommandList5.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 14:25:01 +02:00
Philip Rebohle 61530857d6 vkd3d: Update ID3D12Device to ID3D12Device6.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 14:25:01 +02:00
Philip Rebohle 78b6d291cd vkd3d: Implement D3D12_FEATURE_D3D12_OPTIONS5 feature query.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 10:35:59 +02:00
Philip Rebohle 638dcb1afb vkd3d: Update ID3D12Device to ID3D12Device5.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 10:35:59 +02:00
Philip Rebohle 084f8ed949 vkd3d: Update ID3D12CommandList to ID3D12GraphicsCommandList4.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 10:35:59 +02:00
Philip Rebohle dbeffb0834 vkd3d: Update ID3D12Fence to ID3D12Fence1.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-04-15 10:35:59 +02:00