Commit Graph

408 Commits

Author SHA1 Message Date
Hans-Kristian Arntzen afdbf6edcd vkd3d: Enable VK_KHR_timeline_semaphore extension.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-31 12:51:05 +02:00
Philip Rebohle 8344e8224e vkd3d: Only add feature structs to pNext chain if extension is supported.
RenderDoc will sometimes report extensions as unsupported, but still
fill out and accept the respective feature structs. Since we assume
extensions to be supported if the feature is enabled, we sometimes
try to use functionality that RenderDoc disables and crash.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 11:07:53 +02:00
Philip Rebohle 00d88454ee vkd3d: Factor out extension enumeration.
Besides cleaning up the code, this also allows us to
use information about the available extensions earlier.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 11:07:53 +02:00
Philip Rebohle 34f9cae1c6 vkd3d: Disable unused BufferDeviceAddress features.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 11:07:53 +02:00
Philip Rebohle 643ace438e vkd3d: Store push descriptor properties in device info struct.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-30 10:47:47 +02:00
Philip Rebohle 920d029100 vkd3d: Don't require bindless UAV counters for RESOURCE_BINDING_TIER_3.
Nvidia does not support VK_KHR_buffer_device_address at the moment.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-28 10:39:14 +01:00
Philip Rebohle 8843739797 vkd3d: Require bindless UAV and UAV counters for BINDING_TIER_3.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:37:59 +01:00
Philip Rebohle 577efe9040 vkd3d: Optionally enable VK_KHR_buffer_device_address.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 15:04:23 +01:00
Philip Rebohle facae7690c vkd3d: Replace descriptor mutex with per-descriptor spinlocks.
Greatly improves performance in various games that update or
copy a large number of descriptors per frame due to the high
overhead of pthread_mutex_{un}lock.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-27 13:33:03 +01:00
Philip Rebohle e7360fbd46 vkd3d: Fix build.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 14:39:58 +01:00
Philip Rebohle d4d299d765 vkd3d: Initialize feature options in d3d12_device_caps_init.
Also reworks the check for resource binding tiers.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle 1e78cd3397 vkd3d: Determine maximium feature level in d3d12_device_caps_init.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle bf8863568c vkd3d: Introduce d3d12_device_caps_init.
This method is meant to process d3d12 device caps after the
device itself has been fully initialized. This helps avoid
code duplication in certain instances and guarantees that we
know about all enabled Vulkan features.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle f3e8c156c2 vkd3d: Move minimum feature level check to d3d12_device_create.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle 19b971de0a vkd3d: Introduce d3d12_caps.
Meant to bundle all d3d12 feature caps and options, of which
we're going to have to add more over time.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-19 13:10:18 +01:00
Philip Rebohle ef80658ffb vkd3d: Do not disable storage buffer indexing features.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-18 14:35:35 +01:00
Hans-Kristian Arntzen ceee2096a5 vkd3d: Query subgroup properties and expose SM 6.0 if present.
Does not cover every case for SM 6.0, but it's a useful start.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-18 10:58:17 +01:00
Philip Rebohle c658eda3df vkd3d: Enable VK_EXT_inline_uniform_block if available.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-16 13:54:12 +01:00
Hans-Kristian Arntzen fee9b2bb05 vkd3d: Implement RS 1.0 volatile for packed descriptor set.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-11 12:20:00 +01:00
Philip Rebohle 76f42069f4 vkd3d: Add comment about WoW requiring BINDING_TIER_3 support.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle 8847a78f33 vkd3d: Store vkd3d_physical_device_info with d3d12_device.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 15:25:54 +01:00
Philip Rebohle 01cbbaea81 vkd3d: Create bindless descriptor set layouts.
Don't enable any bindless features for now so that we don't
introduce regressions as features get added.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2020-03-10 14:07:51 +01:00
Hans-Kristian Arntzen 92724ce15c vkd3d: Attempt to create a Vulkan 1.1 instance and device.
Need this to support subgroup operations for SM 6.0.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-03-05 11:03:01 +01:00
Hans-Kristian Arntzen 00eec801de vkd3d: Load Vulkan dynamically in d3d12 test app.
On Windows, it is not ideal to rely on Vulkan being available as a
linkable library as a full install of the Vulkan SDK must be present and
set up, be friendly and load Vulkan dynamically instead.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-24 11:53:29 +01:00
Hans-Kristian Arntzen 484ac51267 vkd3d: Add simple pthread wrapper for MSVC.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-24 11:53:29 +01:00
Hans-Kristian Arntzen 89c516e5da vkd3d: Disable async compute queues for the time being.
Cannot disable VK_EXT_descriptor_indexing as we relied on internal
behavior in RADV related to global_bo_list. Implementing bindless
properly in vkd3d will solve this correctly.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-02-19 15:39:51 +01:00
Conor McCarthy a59f1982ad vkd3d: Remove redundant GetCopyableFootprints() resource size alignment checks.
The alignments are now checked in d3d12_resource_validate_desc().

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:25:50 +01:00
Conor McCarthy 91555883ac vkd3d: Add stub for ID3D12GraphicsCommandList2::WriteBufferImmediate().
ID3D12GraphicsCommandList2 and WriteBufferImmediate() are used by
Hitman 2, but implementing the function on top of an AMD extension has
no effect on game behaviour. It's commonly used to write debug info.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 20:11:15 +01:00
Conor McCarthy 7b88754ff2 vkd3d: Remove alignment validation from GetResourceAllocationInfo().
The right place for alignment validation is d3d12_resource_validate_desc().
The mod alignment test, which returns a size of ~0 on failure, is incorrect
on systems where Vulkan requires alignments of 0x20000 or more, and breaks
Hitman 2, which uses the returned value unchecked and allocates heaps of
0xffffffff bytes.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-27 22:08:37 +01:00
Conor McCarthy af60bc03ba vkd3d: Validate texture resource alignments.
Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-27 22:08:31 +01:00
Philip Rebohle 126a789019 vkd3d: Implement d3d12_command_list_ClearUnorderedAccessViewFloat().
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-25 16:06:59 +01:00
Derek Lesho 1d955506a3 vkd3d: Implement d3d12_device_GetCustomHeapProperties().
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 21:07:18 +01:00
Rémi Bernon 4576236199 vkd3d: Do not report a root signature version higher than requested.
This fixes Shadow of the Tomb Raider crashing because of NULL root
signatures being passed since c002aee119.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-31 19:25:07 +01:00
Hans-Kristian Arntzen fd4488c3ab vkd3d: Optimise the GPU VA allocator.
The GPU VA allocator was allocating memory in a way where dereferencing
GPU VA required a lock + bsearch() to find the right VA range.

Rather than going this route, we turn the common case into O(1) and
lock-free by creating a slab allocator which allows us to lookup a
pointer directly from a GPU VA with (VA - Base) / PageSize.

The number of allocations in the fast path must be limited since we
cannot trivially grow the allocator while remaining lock-free for
dereferences.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:15:34 +01:00
Hans-Kristian Arntzen c7916314dc vkd3d: Align allocated GPU address ranges to the requested resource alignment.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-27 19:15:31 +01:00
Hans-Kristian Arntzen c002aee119 vkd3d: Bump RootSignature version to 1.1.
There appears to be a complete implementation of RS 1.1 already,
so enable this feature.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-22 16:38:59 +02:00
Conor McCarthy 8e6f5ddd24 vkd3d: Make all descriptor reads and writes atomic.
Shadow of the Tomb Raider overwrites descriptors while they are being
copied in another thread. This patch makes reads and writes atomic for
CBV, SRV, UAV, and sampler descriptors, but not RTV and DSV, for which
copying is not implemented.

Benchmark total frames vs mutex count (the single mutex was locked
only once for copying):

1 mutex:    6480 6489 6503
8 mutexes:  6691 6693 6661
16 mutexes: 6665 6682 6703

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-24 17:48:42 +02:00
Józef Kucia 9e997c6db6 vkd3d: Remove old entries in GPU VA allocator.
The "allocations" array is filled with unused entries when D3D12 buffers
are destroyed. The majority of entries might be unused after running for
a while. Remove the entry when VA is freed in order to prevent
accumulation of unused entries. This makes destroying D3D12 buffers more
expensive.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-06 17:05:10 +02:00
Józef Kucia 8df3bfc5c2 vkd3d: Prepend pNext chain structures.
Order of structures doesn't matter so we can simply prepend instead of
apending.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-06 17:05:07 +02:00
Józef Kucia 0184917520 vkd3d: Add support for VK_KHR_image_format_list.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-06 17:04:54 +02:00
Józef Kucia 56d260b40e vkd3d: Use vk_append_struct() in more places.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-31 08:24:42 +02:00
Józef Kucia 8ba2b2baec vkd3d: Use macros to define optional extensions tables.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-31 08:24:40 +02:00
Józef Kucia ee7d24a213 vkd3d: Add support for VK_EXT_shader_demote_to_helper_invocation.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-31 08:24:38 +02:00
Józef Kucia 46ff2c2764 vkd3d: Add support for VK_EXT_texel_buffer_alignment.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-05 17:52:13 +02:00
Józef Kucia 69e73a6a8f vkd3d: Implement D3D12_FEATURE_FORMAT_INFO.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-28 08:10:53 +02:00
Józef Kucia fb8f0dc5b3 vkd3d: Create private heap objects for committed resources.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-21 08:09:20 +02:00
Józef Kucia f723a791d5 tests: Add test for parsing version.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-18 16:40:46 +02:00
Józef Kucia 3d681737c9 vkd3d: Try to guess application name.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-18 16:40:41 +02:00
Józef Kucia e912a2c329 vkd3d: Validate resource pointer for transition barriers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-18 16:40:33 +02:00
Conor McCarthy 901fb7e798 vkd3d: Implement d3d12_command_list_SetPredication().
Predicate arguments which are only non-zero in bit 32 or higher are not
supported. Predicates will not be applied to clear and copy commands because
Vulkan does not support predication of these command classes.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 20:53:39 +02:00
Józef Kucia 285a19408f vkd3d: Introduce FIXME_ONCE().
The debug log level is demoted to WARN after the FIXME is printed once.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-12 22:37:44 +02:00
Józef Kucia 7ecd67aaa0 vkd3d: Factor out vkd3d_join_thread().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 23:25:51 +02:00
Józef Kucia bc5e8a9cc2 vkd3d: Factor out vkd3d_create_thread().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 23:25:49 +02:00
Józef Kucia 826190fc0e vkd3d: Prefer uint64_t to UINT64.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-11 23:25:44 +02:00
Józef Kucia c756008f6e vkd3d: Introduce vkd3d_physical_device_info.
Simplifies passing around Vulkan physical device properties and features.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 12:24:36 +02:00
Józef Kucia 068851b159 vkd3d: Add initial checks for feature levels 12_0+.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:46:39 +02:00
Józef Kucia 9f49174f40 vkd3d: Use sparse resources for emulating NULL UAVs.
If residencyNonResidentStrict is supported.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:46:37 +02:00
Józef Kucia 71ad883672 vkd3d: Implement d3d12_device_CreateReservedResource().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:46:34 +02:00
Philip Rebohle ca744ae579 vkd3d: Enable VK_KHR_draw_indirect_count.
Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-20 20:33:33 +02:00
Józef Kucia 51b930192a vkd3d: Handle lists in debug env vars consistently.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-17 20:41:09 +02:00
Józef Kucia 8782764434 vkd3d: Return S_OK from memory residency functions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-16 20:29:06 +02:00
Józef Kucia 08e2e583b5 vkd3d: Introduce vkd3d_application_info.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-13 12:47:44 +02:00
Józef Kucia e01eae5b8a vkd3d: Use D32_SFLOAT_S8_UINT when D24_UNORM_S8_UINT is not supported.
Fixes rendering in UE4 Infiltrator Demo on AMD.

Adjustments for depth bias aren't implemented yet.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-09 08:21:04 -05:00
Józef Kucia 9536f10383 vkd3d: Pass device to vkd3d_get_format().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-09 08:21:02 -05:00
Józef Kucia 7c8ce3c51c vkd3d: Pass device to vkd3d_format_from_d3d12_resource_desc().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-09 08:20:59 -05:00
Józef Kucia 205a41aaaa vkd3d: Introduce queue sequence numbers to track unused Vulkan semaphores.
In preparation for the following commmit.

Sequence numbers allows us to more easily track progress on queues in
comparison to tracking each VkFence individually.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-03 16:35:06 +02:00
Józef Kucia 2126614a03 vkd3d: Allow simultaneous buffer access from multiple queues.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-03 16:34:58 +02:00
Józef Kucia e7b94e0337 vkd3d: Enable Vulkan debug extensions independently of debug log level.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-01 22:54:23 +02:00
Józef Kucia 081239fd90 vkd3d: Trace returned features.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-01 22:54:07 +02:00
Józef Kucia 5da59641b0 vkd3d: Share Vulkan render pass objects between D3D12 pipeline states.
For example, World of Warcraft creates 28 render passes for pipeline
state objects instead of 600+ render passes. Other games appears to use
similarly low number of render passes, e.g. 8, 17, 26, 60.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-30 09:25:34 +02:00
Józef Kucia ec458df6ff vkd3d: Fix device features structure chain.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-10 18:56:50 +02:00
Józef Kucia abdaa20376 vkd3d: Fix memory leak in vkd3d_init_device_caps() (Coverity).
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-08 19:39:32 +02:00
Józef Kucia a95c9f8ad8 vkd3d: Add support for VK_EXT_depth_clip_enable.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-04 17:25:31 +02:00
Józef Kucia 41274e6285 vkd3d: Drop support for dummy sampler.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-04 17:25:23 +02:00
Zhiyi Zhang 32a15c089a vkd3d: Improve UMA memory detection.
Some vulkan implementation report 2 memory types with the same
VkMemoryPropertyFlags for a device. So check property flags
to determine if UMA and CacheCoherentUMA are actually supported
by the device.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-04 17:25:15 +02:00
Józef Kucia a1ec97ca2a vkd3d: Enable VK_EXT_descriptor_indexing.
This extension brings dynamic indexing for all descriptor types and the
update after bind feature.

VK_KHR_maintenance3 is required by VK_EXT_descriptor_indexing.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-02 19:34:01 +02:00
Józef Kucia 91e88a820e vkd3d: Avoid copying empty ranges in d3d12_device_CopyDescriptors().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-02 19:33:51 +02:00
Józef Kucia ee673a9db5 vkd3d: Use dedicated allocation for committed resources.
Dedicated allocations may improve the performance.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-29 00:21:06 +01:00
Józef Kucia 3d3f640590 vkd3d: Add more Vulkan feature checks.
Sort the list alphabetically.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-29 00:21:02 +01:00
Józef Kucia 6ee8529390 vkd3d: Add support for optional device extensions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-29 00:21:00 +01:00
Józef Kucia 053a2b0f52 vkd3d: Trace device properties for selected device.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-29 00:20:58 +01:00
Józef Kucia 4cdbcbd85f vkd3d: Do not require dlfcn.
For Windows builds.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-19 18:41:42 +01:00
Józef Kucia 05666d3385 vkd3d: Add VKD3D_VULKAN_DEVICE debug environment variable.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-14 23:53:34 +01:00
Józef Kucia b0c8561cff vkd3d: Fix feature queries for depth/stencil formats.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-11 19:17:27 +01:00
Józef Kucia f1bfb1305e vkd3d: Update command list to ID3D12GraphicsCommandList1.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-07 19:01:14 +01:00
Józef Kucia f640602ce8 vkd3d: Add feature level 11_1.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-06 16:00:27 +01:00
Józef Kucia 38e3c5d2d3 vkd3d: Rework Vulkan queues initialisation.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-06 16:00:25 +01:00
Józef Kucia 401739a387 vkd3d: Emulate NULL CBV descriptors.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-04 19:46:05 +01:00
Józef Kucia 2ce7b2305a vkd3d: Implement SO statistics queries.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-20 19:15:03 +01:00
Józef Kucia f98866f7d8 vkd3d: Return the same value for MaxGPUVirtualAddressBitsPerResource.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 16:01:09 +01:00
Józef Kucia a2f38f88e2 vkd3d: Do not advertise tiled resource support.
Tiled resources are not implemented yet.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 16:01:03 +01:00
Józef Kucia 52e44b5533 vkd3d: Trace decoded driver versions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-14 16:01:01 +01:00
Józef Kucia 269bb649d7 vkd3d: Improve heuristic for selecting physical device.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-13 17:21:39 +01:00
Zhiyi Zhang bff7218091 vkd3d: Implement d3d12_device_SetName().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-05 19:26:22 +01:00
Zhiyi Zhang d0e2802a35 vkd3d: Implement d3d12_query_heap_SetName().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-30 18:35:38 +01:00
Józef Kucia 9370929ac1 vkd3d: Implement D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-25 18:59:35 +01:00
Józef Kucia 766361f9c3 vkd3d: Return hardcoded GPU virtual address support.
The hardcoded value makes a real app happy and it is close to values
returned by various Windows drivers (AMD, Intel, Nvidia). In the long
term, we might try to derive the values from maxResourceSize and/or
sparseAddressSpaceSize.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-25 18:59:32 +01:00
Józef Kucia ec49d3ebd2 vkd3d: Allow D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT only when explicitly requested.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-22 16:36:02 +01:00
Józef Kucia 8f3db5ecef vkd3d: Simplify d3d12_device_GetResourceAllocationInfo().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-22 16:36:01 +01:00
Józef Kucia 39eb9fe5d8 vkd3d: Allow D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT only for small textures.
Use a simple heuristic to decide if a resource is "small". The heuristic
is based on theoretical constraints for the most detailed mip level of
small resources. Those constraints are mentioned in D3D12 validation
layer errors and in the DirectX 12 Graphics samples.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-22 16:35:59 +01:00
Józef Kucia aff7ff4fcf vkd3d: Handle base offset in GetCopyableFootprints().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-22 16:35:55 +01:00
Józef Kucia 61dd136cab vkd3d: Implement RasterizedStream.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-14 20:31:08 +01:00
Józef Kucia 5759cb52e0 vkd3d: Enable VK_EXT_transform_feedback.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-14 20:31:01 +01:00
Józef Kucia 2629d9703f vkd3d: Protect private data with mutex.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-10 10:03:53 -06:00
Józef Kucia 567000cab3 vkd3d: Implement private data for ID3D12Device.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-01-03 17:19:04 +01:00
Józef Kucia b868b5a258 vkd3d: Avoid out-of-bounds array access in d3d12_device_CopyDescriptors().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-12 17:08:42 +01:00
Józef Kucia 3e8d0e7a6a vkd3d: Get rid of asserts from d3d12_device_CopyDescriptors().
Do not require that source range sizes match destination range sizes.
It works on Windows even though D3D12 validation layers throw errors
about size mismatches.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 18:50:16 +01:00
Józef Kucia a5646b3aff vkd3d: Use at least D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT for textures.
It's the smallest alignment for textures supported by D3D12. Vulkan
implementations may return lower values.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-16 18:41:45 +01:00
Józef Kucia d539adaff8 vkd3d: Translate pthread error numbers to HRESULTs.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-12 10:31:25 +01:00
Józef Kucia a08dadde32 vkd3d: Avoid division by zero in GetResourceAllocationInfo() (Coverity).
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-29 17:08:30 +01:00
Józef Kucia ebde6bd229 vkd3d: Implement instance data step rate.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-25 14:54:52 +02:00
Józef Kucia b2dc48c611 vkd3d: Trace VK_EXT_vertex_attribute_divisor properties.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-25 14:54:50 +02:00
Józef Kucia db27883740 vkd3d: Trace VK_EXT_vertex_attribute_divisor features.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-25 14:54:48 +02:00
Józef Kucia 2e8b3863f3 vkd3d: Do not trace features for all available physical devices.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-25 14:54:45 +02:00
Józef Kucia 5e6b35af8e vkd3d: Enable VK_EXT_vertex_attribute_divisor.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-25 14:53:26 +02:00
Józef Kucia 8f07e14711 vkd3d: Store compiled Vulkan pipelines in d3d12_graphics_pipeline_state.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-24 17:00:51 +02:00
Józef Kucia 8e46f5ebf6 vkd3d: Remove "unhandled next" warnings.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-18 00:59:36 +02:00
Józef Kucia c296cbe30b vkd3d: Implement D3D12_FEATURE_SHADER_MODEL.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-08 22:25:04 +02:00
Józef Kucia f7bb28dc2b vkd3d: Do not enable shaderTessellationAndGeometryPointSize feature.
We don't want to write PointSize in tessellation and geometry shaders.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-01 18:36:43 -07:00
Józef Kucia f1c967ab38 vkd3d: Fix potential memory leak in vkd3d_create_vk_device().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-28 20:57:34 +02:00
Józef Kucia 6f73364634 vkd3d: Add requirements for maxPerStageDescriptorUniformBuffers.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-28 20:33:07 +02:00
Józef Kucia 82fdd800e2 vkd3d: Pass VkQueueFamilyProperties to vkd3d_queue_create().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-28 01:12:37 +02:00
Józef Kucia 873a26a061 vkd3d: Simplify error handling in vkd3d_create_vk_device().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-28 01:12:35 +02:00
Józef Kucia 0014c4fbf9 vkd3d: Implement d3d12_device_GetResourceAllocationInfo() for textures.
In Vulkan, we have to create an image to get its memory requirements.
It would be very helpful if we could get the memory requirements without
creating a resource.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-26 19:26:24 +02:00
Józef Kucia 99e239ad50 vkd3d: Implement d3d12_device_GetResourceAllocationInfo() for buffers.
In Direct3D12, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT is always used
for buffers. We could try to use a lower alignment when supported by
the Vulkan implementation, but there is no way to get buffer memory
requirements without creating a buffer in Vulkan.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-26 19:26:18 +02:00
Józef Kucia e93fed2c93 vkd3d: Add support for fake placed resources.
Placed resources are not allocated from a given heap yet.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-26 19:26:15 +02:00
Józef Kucia 0e8fc6e957 vkd3d: Fix leaks if d3d12_device_init_pipeline_cache() fails.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-13 19:26:22 +02:00
Józef Kucia 11c00a157c vkd3d: Implement simple pipeline cache.
Ideally, we would like to introduce a Vulkan extension to make vertex
buffer strides and primitive topology dynamic in Vulkan.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-12 23:16:21 +02:00
Józef Kucia e7eb9ca936 vkd3d: Simplify d3d12_device_init().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-12 23:16:19 +02:00
Józef Kucia 605cb12eca vkd3d: Set pointer to NULL if heap creation fails.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-12 23:16:12 +02:00
Józef Kucia 150d1f0eb8 vkd3d: Set pointer to NULL if committed resource creation fails.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-12 23:16:08 +02:00
Chip Davis 61697e092a build: Detect soname of libvulkan at configure time.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-21 19:04:48 +02:00
Józef Kucia d175afad78 vkd3d: Add support for optional instance extensions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-20 09:54:32 +02:00
Józef Kucia d9d37d1563 libs/vkd3d: Implement d3d12_device_CreateHeap().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-20 18:19:47 +02:00
Józef Kucia cc47b37c1d libs/vkd3d: Factor out debug_ignored_node_mask().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-20 18:19:46 +02:00
Józef Kucia a5a17c22f1 libs/vkd3d: Introduce d3d12_resource_validate_desc().
Share D3D12_RESOURCE_DESC validation code between
CreateCommittedResource() and GetCopyableFootprints().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-20 18:19:39 +02:00
Józef Kucia 8400832eea libs/vkd3d: Change return_interface() iface parameter type to void pointer.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-20 18:19:35 +02:00
Józef Kucia b9a0907691 libs/vkd3d: Support D3D12_FEATURE_ROOT_SIGNATURE.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-19 16:51:04 +02:00
Józef Kucia 404e988ecd libs/vkd3d: Trace build version.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-27 22:43:49 +02:00
Józef Kucia b5d1dbd182 libs/vkd3d: Rename default sampler to dummy sampler.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-24 23:29:36 +02:00
Józef Kucia f0a1e14113 libs/vkd3d: Mark device as removed when command list in recording state is executed.
Fixes a GPU hang in test_device_removed_reason() on RADV.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-16 21:59:57 +02:00
Józef Kucia e6e62e8a8e libs/vkd3d: Add support for VK_EXT_debug_report.
For debug messages from Vulkan drivers.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-11 18:56:10 +02:00
Józef Kucia 28e0ab6481 libs/vkd3d: Fix copying descriptors with NULL destination range sizes.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-11 18:56:03 +02:00
Józef Kucia f5b532921a libs/vkd3d: Add structure type fields to public API structures.
Adds flexibility for future API extensions.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-03 21:59:35 +02:00
Józef Kucia 26cbfbe647 libs/vkd3d: Implement d3d12_command_list_CopyResource() for textures.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-28 19:48:23 +02:00
Józef Kucia 953a924ca0 libs/vkd3d: Fix copying descriptors with NULL source range sizes.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-28 19:48:21 +02:00
Józef Kucia 3f235f9787 libs/vkd3d: Fix error message in vkd3d_check_extensions().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-28 19:48:17 +02:00
Józef Kucia dd6dedd9d1 libs/vkd3d: Add remaining helper functions for CPU descriptor handles.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-08 21:59:04 +01:00
Józef Kucia 65aab7b47b libs/vkd3d: Use PFN prefix for function pointer typedefs.
A more common convention, e.g. Vulkan uses it.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-06 21:35:33 +01:00
Józef Kucia 372bd56ade libs/vkd3d: Add support for device parent.
In order to hold a reference to IDXGIAdapter.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-02 18:49:52 +01:00
Józef Kucia a25a2086a5 libs/vkd3d: Do not enable swapchain extensions by default.
libvkd3d doesn't use them.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-24 22:32:20 +01:00
Józef Kucia fc31637040 libs/vkd3d: Allow library user to enable additional device extensions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-24 22:32:14 +01:00
Józef Kucia 4cd36fc553 libs/vkd3d: Implement d3d12_device_GetAdapterLuid().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-23 21:42:08 +01:00
Józef Kucia c9c6caae98 libs/vkd3d: Allow library user to enable additional instance extensions.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-23 21:42:06 +01:00
Józef Kucia ebca1d3396 libs/vkd3d: Validate signal_event_pfn.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-19 18:49:58 +01:00
Józef Kucia 6a32ad8913 libs/vkd3d: Rename vkd3d_get_vk_instance() to vkd3d_instance_get_vk_instance().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-19 18:49:56 +01:00
Józef Kucia c64181345b libs/vkd3d: Simplify vkd3d_restrict_format_support_for_feature_level().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-19 18:49:53 +01:00
Józef Kucia 783a2c2cdf libs/vkd3d: Use vkGetInstanceProcAddr() to load global Vulkan functions.
It's enough to load vkGetInstanceProcAddr() in a platform-specific way.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-18 16:22:01 +01:00
Józef Kucia 10b04414e8 libs/vkd3d: Load libvulkan dynamically.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-18 16:21:51 +01:00
Józef Kucia fcc6846559 libs/vkd3d: Allow library user to load libvulkan.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-18 16:21:44 +01:00
Józef Kucia 8883502121 libs/vkd3d: Introduce function to get Vulkan instance from vkd3d instance.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-18 16:21:32 +01:00
Józef Kucia b0aa4ed434 libs/vkd3d: Add simple format support restrictions.
In the long term, we may need more complex format support filtering.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-18 16:21:29 +01:00
Józef Kucia ae014a29c4 libs/vkd3d: Allow library user to select Vulkan physical device.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-16 20:11:23 +01:00
Józef Kucia d18e986b27 libs/vkd3d: Make GPU VA allocator thread-safe.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-15 17:51:35 +01:00
Józef Kucia db2e1d402e libs/vkd3d: Synchronize access to Vulkan queues.
Access to VkQueue must be externally synchronized.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-15 17:51:32 +01:00
Józef Kucia 4605d1275c libs/vkd3d: Validate WCHAR size.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-12 19:27:06 +01:00
Józef Kucia 0f46ae3e55 libs/vkd3d: Add API for creating vkd3d instances.
Makes possible to share a Vulkan instance between multiple devices.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-12 19:27:01 +01:00
Józef Kucia 604056daf4 libs/vkd3d: Allow library user to create internal threads.
We want to create Win32 threads when running under Wine.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-12 19:26:58 +01:00
Józef Kucia 7fa3f2ed1a libs/vkd3d: Add FIXME comment for GPU VA allocator. 2017-10-18 11:54:56 +02:00
Józef Kucia 5b5cffcf84 libs/vkd3d: Implement creating root signature from bytecode. 2017-10-10 16:02:09 +02:00
Henri Verbeet 53654baab9 libs/vkd3d: Support D3D12_FEATURE_FORMAT_SUPPORT in d3d12_device_CheckFeatureSupport(). 2017-10-10 13:09:32 +02:00
Józef Kucia fecc94cebc libs/vkd3d: Add helpers for dereferencing descriptor handles. 2017-10-04 13:55:33 +02:00
Józef Kucia 8cb004bdc4 libs/vkd3d: Create single default sampler per device. 2017-09-21 15:12:13 +02:00
Józef Kucia 90cf804d9b libs/vkd3d: Use Vulkan pipeline cache for graphics pipelines. 2017-09-19 10:58:04 +02:00
Józef Kucia d2e7fcdf77 libs/vkd3d: Add environment variable for disabling Vulkan extensions.
It's useful for testing, e.g. VKD3D_DISABLE_EXTENSIONS=VK_KHR_push_descriptor
2017-09-18 15:40:42 +02:00
Józef Kucia 67641a8999 libs/vkd3d: Initialize device feature options in vkd3d_init_device_caps(). 2017-09-14 15:38:19 +02:00
Józef Kucia 554d07df06 libs/vkd3d: Warn about unmet feature level 11_0 requirements.
This isn't necessarily exhaustive.
2017-09-14 15:38:19 +02:00
Józef Kucia a77376121d libs/vkd3d: Require VK_KHR_shader_draw_parameters device extension. 2017-09-12 17:42:42 +02:00
Józef Kucia 495bd6fddc libs/vkd3d: Create Vulkan buffer views for UAV counter resources. 2017-09-07 17:15:53 +02:00
Józef Kucia 603a44fb46 libs/vkd3d: Implement d3d12_device_CopyDescriptors().
There is no easy way to duplicate or copy Vulkan views and samplers.
Therefore, we use reference counting for Vulkan views and samplers when
copying them between descriptor heaps.
2017-09-04 18:33:09 +02:00
Józef Kucia d8847aa462 libs/vkd3d: Fix texture region copying for miplevels other than 0. 2017-08-31 09:42:50 +02:00
Józef Kucia 0dca9909d9 libs/vkd3d: Copy single layer for array textures in d3d12_command_list_CopyTextureRegion(). 2017-08-31 09:42:50 +02:00
Henri Verbeet f1aa742569 libs/vkd3d: Support D3D12_FEATURE_D3D12_OPTIONS in d3d12_device_CheckFeatureSupport(). 2017-08-30 18:11:38 +02:00
Henri Verbeet 6f14c77a7a libs/vkd3d: Explicitly initialise the queue timestamp bits variables in vkd3d_create_vk_device().
Avoids -Wmaybe-uninitialized warnings with gcc 4.9.2. More recent
versions of gcc are able to figure it out by themselves.
2017-08-30 18:11:34 +02:00
Józef Kucia f8ef6630df libs/vkd3d: Implement d3d12_device_CopyDescriptorsSimple(). 2017-08-30 16:41:41 +02:00
Henri Verbeet 3019a3e8f1 libs/vkd3d: Support both native and Win32 wchar_t. 2017-08-29 16:36:05 +02:00
Sven Hesse 5b6bd40464 libs/vkd3d: Cache the number of valid bits in queue timestamp queries. 2017-08-29 15:16:41 +02:00
Henri Verbeet e228d776be libs/vkd3d: Fix the d3d12_query_heap_create() argument order. 2017-08-28 20:37:03 +02:00
Henri Verbeet b000952e4f libs/vkd3d: Implement indirect draws. 2017-08-28 19:26:31 +02:00
Sven Hesse 79cbc900bc libs/vkd3d: Create Vulkan Query Pools for D3D12 Query Heaps. 2017-08-23 16:18:15 +02:00
Józef Kucia 08284f0f85 libs/vkd3d: Fix draw calls with no framebuffer attachments. 2017-08-18 17:08:56 +02:00
Józef Kucia 1d5b8b7d32 libs/vkd3d: Implement depth/stencil resource views. 2017-08-16 17:38:33 +02:00
Józef Kucia 67697f2b8f libs/vkd3d: Factor out vkd3d_enable_extensions() function. 2017-08-16 17:38:33 +02:00
Józef Kucia 043d4d0acf libs/vkd3d: Factor out vkd3d_check_extensions() function. 2017-08-16 17:38:33 +02:00
Józef Kucia 4a767a8f11 libs/vkd3d: Enable VK_KHR_get_physical_device_properties2 instance extension.
Required for VK_KHR_push_descriptor. Validation layers complain when
required extensions are not enabled.
2017-08-11 13:58:04 +02:00
Józef Kucia 9b54e0df17 libs/vkd3d: Add VK_KHR_push_descriptor extension. 2017-08-11 13:58:04 +02:00
Józef Kucia e01cc64d82 libs/vkd3d: Fix d3d12_device_GetCopyableFootprints() for 3D textures. 2017-08-09 19:38:06 +02:00
Józef Kucia 624699f5e6 libs/vkd3d: Add FIXME comment about sharing D3D12_RESOURCE_DESC validation code. 2017-08-09 19:38:06 +02:00
Sven Hesse 4d540d5b45 libs/vkd3d: Delete DXGI_FORMAT_UNKNOWN from the formats table again.
Put it into a local in GetCopyableFootprints() instead.
2017-08-09 17:15:05 +02:00
Sven Hesse ae63b4f0a5 libs/vkd3d: Implement GetCopyableFootprints for DIMENSION_TEXTURE3D. 2017-08-09 15:16:08 +02:00