Commit Graph

249 Commits

Author SHA1 Message Date
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
Sven Hesse eebad15d62 libs/vkd3d: Implement GetCopyableFootprints for DIMENSION_TEXTURE1D. 2017-08-09 15:11:20 +02:00
Sven Hesse 3353643772 libs/vkd3d: Implement GetCopyableFootprints for DIMENSION_BUFFER. 2017-08-09 15:08:52 +02:00
Józef Kucia 074513dc4d libs/vkd3d: Add support for sampler descriptors in root descriptor tables. 2017-08-04 17:06:33 +02:00
Józef Kucia 0859b94833 libs/vkd3d: Implement d3d12_device_CreateConstantBufferView(). 2017-08-04 17:06:33 +02:00
Sven Hesse 6de74f6cc3 libs/vkd3d: Don't calculate footprints for unaligned compressed textures. 2017-08-04 14:36:19 +02:00
Sven Hesse a0675d1ba7 libs/vkd3d: Calculate footprint total size using row count, not height. 2017-08-04 14:35:02 +02:00
Sven Hesse 6629301ece libs/vkd3d: Implement GetCopyableFootprints() for compressed formats. 2017-08-02 14:04:31 +02:00
Henri Verbeet 605a02274e libs/vkd3d: Allocate GPU virtual addresses for resources.
Direct3D 12 resources, buffers in particular, are bound to the pipeline
by their GPU virtual address. In Vulkan, these addresses are not visible
to the application. We previously handled this by returning the VkBuffer
handle as virtual address, but this can't work when the application
binds anything other than the resource's base GPU VA. Instead, we
allocate ranges of GPU address space and associate resources with it.

This uses the (naive) approach of simply allocating subsequent ranges,
and never reclaiming them. Eventually we'll have to revisit that.
2017-07-27 16:28:46 +02:00
Henri Verbeet 1acd3d44b1 Implement d3d12_device_CreateQueryHeap(). 2017-07-27 16:28:29 +02:00
Henri Verbeet e9046a81cc Implement d3d12_device_CreateCommandSignature(). 2017-07-27 16:28:24 +02:00
Józef Kucia 5ac8dbfc64 libs/vkd3d: Implement d3d12_device_CreateUnorderedAccessView(). 2017-07-25 12:50:14 +02:00
Józef Kucia 00606b7dff libs/vkd3d: Fix logic for choosing compute-only queue family index. 2017-07-21 22:29:12 +02:00
Józef Kucia d35ffe53ad libs/vkd3d: Initialize device->compute_queue_family_index.
Fixes dadce84a4b.
2017-07-21 22:29:12 +02:00
Sven Hesse dadce84a4b libs/vkd3d: Create a compute queue family. 2017-07-21 15:24:57 +02:00
Józef Kucia 1c79831873 libs/vkd3d: Implement d3d12_device_CreateShaderResourceView(). 2017-07-14 13:44:35 +02:00
Józef Kucia f4f803c7bb libs/vkd3d: Add initial implementation for d3d12_device_GetCopyableFootprints(). 2017-07-13 11:56:30 +02:00
Józef Kucia f3d297574a libs/vkd3d: Implement d3d12_device_CreateSampler(). 2017-07-12 13:10:44 +02:00
Józef Kucia d515e3d047 libs/vkd3d: Require VK_KHR_maintenance1 device extension. 2017-06-21 22:00:19 +02:00
Józef Kucia 84889646f6 Update license to LGPL v2.1. 2017-06-16 22:11:21 +02:00
Henri Verbeet f252d6cd31 libs/vkd3d: Implement d3d12_device_CreateDepthStencilView(). 2016-11-10 16:42:24 +01:00
Józef Kucia e42a9da943 libs/vkd3d: Use VK_KHR_*_EXTENSION_NAME defines. 2016-10-24 15:28:08 +02:00
Henri Verbeet fa5b972371 demos/triangle: Add a demo program. 2016-10-24 13:57:05 +02:00
Henri Verbeet b760b52859 libs/vkd3d: Export a function to get the Vulkan physical device from a d3d12 device. 2016-10-24 13:57:05 +02:00
Józef Kucia 384bb26ea5 libs/vkd3d: Naming conventions. 2016-10-20 16:38:04 +02:00
Józef Kucia 60959ecf3c libs/vkd3d: Add partial support for D3D12_FEATURE_ARCHITECTURE. 2016-10-19 13:10:12 +02:00
Henri Verbeet 7568a9793c libs/vkd3d: Export a function to get the Vulkan device from a d3d12 device. 2016-10-19 10:02:27 +02:00
Henri Verbeet feacd1af50 libs/vkd3d: Export a function to get the Vulkan instance from a d3d12 device. 2016-10-19 10:02:04 +02:00
Henri Verbeet 2a49173b60 libs/vkd3d: Export a function to create a d3d12 resource from a Vulkan image. 2016-10-19 09:59:42 +02:00
Józef Kucia 1e73f2956a libs/vkd3d: Return S_OK from d3d12_device_GetDeviceRemovedReason(). 2016-10-17 14:24:22 +02:00
Józef Kucia 1fad443900 libs/vkd3d: Introduce vkd3d_select_physical_device() helper function. 2016-10-13 12:21:00 +02:00
Józef Kucia a1082ec954 libs/vkd3d: Use "< 0" to test VkResult for errors.
For consistency.
2016-10-11 13:43:04 +02:00
Henri Verbeet 5c9ea3ede3 libs/vkd3d: Implement d3d12_device_CreateGraphicsPipelineState(). 2016-10-10 17:26:38 +02:00
Józef Kucia a22b594c0a libs/vkd3d: Accept D3D12_ROOT_SIGNATURE_DESC directly only when all bits of "bytecode_length" are set. 2016-10-10 11:22:50 +02:00
Józef Kucia 59d466af2d libs/vkd3d: Use PRIx64 to print 64-bit integers. 2016-10-10 11:22:50 +02:00
Józef Kucia 2a7b614278 libs/vkd3d: Wait for GPU fences in worker thread.
This could be implemented without a worker thread, if event objects
would be tightly coupled with ID3D12Fences.
2016-10-08 14:31:57 +02:00
Józef Kucia 2f76260857 libs/vkd3d: Create fence worker thread per device. 2016-10-08 14:31:57 +02:00
Józef Kucia ef6a3d78a2 libs/vkd3d: Pass signal event function pointer to vkd3d_create_device(). 2016-10-07 13:26:39 +02:00
Henri Verbeet 1b8be72657 libs/vkd3d: Implement d3d12_device_CreateRenderTargetView(). 2016-09-30 13:34:17 +02:00
Henri Verbeet 9262f87249 libs/vkd3d: Allocate CPU memory for descriptors. 2016-09-30 13:33:28 +02:00
Józef Kucia 31f1d703a9 libs/vkd3d: Add ID3D12Fence interface stub. 2016-09-28 15:24:03 +02:00
Józef Kucia fec147c2cb libs/vkd3d: Implement committed texture resources. 2016-09-27 12:13:37 +02:00
Józef Kucia 5e266f70a2 libs/vkd3d: Store VkPhysicalDeviceMemoryProperties in "d3d12_device". 2016-09-27 12:13:37 +02:00
Józef Kucia 6e68570498 libs/vkd3d: Create VkCommandPool when creating ID3D12CommandAllocator. 2016-09-27 12:13:37 +02:00
Józef Kucia 2424137c0b libs/vkd3d: Implement compute pipeline state. 2016-09-26 11:46:45 +02:00
Józef Kucia fdf8eb775f libs/vkd3d: Implement empty root signature. 2016-09-26 11:46:45 +02:00
Józef Kucia a524488c78 libs/vkd3d: Fix memory leak in d3d12_device_create(). 2016-09-26 11:46:45 +02:00
Józef Kucia 471a58b4b8 libs/vkd3d: Add ID3D12PipelineState interface stub. 2016-09-26 11:22:33 +02:00
Józef Kucia aec10bd682 libs/vkd3d: Add ID3D12RootSignature interface stub. 2016-09-26 11:22:33 +02:00
Józef Kucia 13ccddd6e4 libs/vkd3d: Add ID3D12DescriptorHeap interface stub. 2016-09-26 11:22:33 +02:00
Józef Kucia 4175bec471 libs/vkd3d: Add ID3D12Resource interface stub. 2016-09-26 11:22:33 +02:00
Józef Kucia 2a99c21534 libs/vkd3d: Create Vulkan device when creating D3D12 device. 2016-09-22 17:15:41 +02:00
Józef Kucia f86ca50443 libs/vkd3d: Create Vulkan instance when creating D3D12 device.
We link directly to the Vulkan loader library and use few exported
procedures. According to the documentation the loader library
exports all core Vulkan procedures on Windows, Linux and Android.
2016-09-22 16:56:58 +02:00
Józef Kucia 6bdc509e4d libs/vkd3d: Add ID3D12GraphicsCommandList interface stub. 2016-09-21 17:46:03 +02:00
Józef Kucia 4636663bd5 libs/vkd3d: Add ID3D12CommandAllocator interface stub. 2016-09-21 17:46:03 +02:00
Józef Kucia 4426e099ab libs/vkd3d: Partially implement d3d12_device_CheckFeatureSupport(). 2016-09-21 17:46:03 +02:00
Józef Kucia aea273550a libs/vkd3d: Add ID3D12CommandQueue interface stub. 2016-09-21 17:46:03 +02:00
Józef Kucia 0444bb72b5 libs/vkd3d: Introduce debugstr_uint64() to print UINT64 values. 2016-09-21 17:46:03 +02:00
Józef Kucia d6e2fe97a4 libs/vkd3d: Add ID3D12Device interface stub. 2016-09-21 12:57:24 +02:00