Commit Graph

59 Commits

Author SHA1 Message Date
Joshua Ashton 3e4a8b1504 vkd3d: Remove type/next from vkd3d device/instance structures
There's really no reason to overcomplicate adding optional extensions this way.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton bd988f2b74 vkd3d: Remove vkd3d_optional_device_extensions_info
Roll this into vkd3d_device_create_info, no need for this to be a pNext thing.

Additionally, fix some memory leaks on device creation failure.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Joshua Ashton 59148c1932 vkd3d: Remove vkd3d_optional_instance_extensions_info
Roll this into vkd3d_instance_create_info, no need for this to be a pNext thing.

Additionally, fix some memory leaks on instance creation failure.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-20 18:25:41 +02:00
Philip Rebohle f06f94bfb4 vkd3d: Enable multi_queue by default.
And replace option with a single_queue flag to do the opposite.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
2021-04-19 16:40:49 +02:00
Joshua Ashton 043fd304f8 vkd3d-shader: Add force_tgsm_barriers config flag
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 16:29:57 +02:00
Joshua Ashton 41df41305e include: Move vkd3d_config_flags to public header
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-04-12 16:29:57 +02:00
Joshua Ashton 2fa97aa0fb vkd3d: Move API versions to public header
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-22 14:29:45 +01:00
Joshua Ashton 64a6bae1a0 vkd3d: Remove vkd3d_application_info structure
This thing has no right to exist.

We don't get this information in D3D12 and it's getting in the way of me refactoring config flags.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-03-02 11:09:29 +01:00
Joshua Ashton fccbd3b5e2 vkd3d: Eliminate wchar_size, use UTF-16 string literals
Achieves this with C standard stuff alone, and no compiler hacks.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-02-09 11:26:28 +01:00
Joshua Ashton 4fb3e277f1 vkd3d: Remove VKD3D_RESOURCE_PRESENT_STATE_TRANSITION
All this flag does is make resource creation fail.

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-22 09:30:24 +02:00
Hans-Kristian Arntzen d7e9713c4c vkd3d: Add external API to perform initial transition.
Relevant for swapchain since a swapchain resource can be presented right
away without ever having been touched by an API call.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-16 13:25:59 +01:00
Hans-Kristian Arntzen 4dff80661a vkd3d: Rewrite initial resource state tracking.
For correctness, we will need to defer any initial resource state
handling to the queue timeline. Here, we will build an UNDEFINED ->
common layout barrier if (and only if):

- The resource is marked to care about initial layout transition.
- We are the first queue thread to observe that initial_transition
  member is 1 (atomic exchange).
- The first use of the resource was not marked to be a discard.
  E.g., if the first use of the resource is an alias barrier, we must
  not emit an early barrier. The only we should do here is to clear the
  initial_transition member, and leave it like that.

A command list maintains a list of d3d12_resources which *might* need a
transition. For the first frame a resource is used (or so), it will not
have the flag cleared yet, so multiple command lists might add the
d3d12_resource to its own transition list. This is fine, as the queue
will resolve it.

If multiple queues see the same initial transition, there might be
shenanigans, but the application must ensure there is either a
submission boundary or fence boundary between the uses. Any initial
layout transition will only be submitted after a Wait() is observed, as
submission of the transition command buffer will be in-order with other
submissions.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
2020-10-08 14:30:50 +02:00
Joshua Ashton a991fddeeb build: Use `-fvisibility=hidden` and define exports manually
When building natively on Windows we use dllexport/dllimport for vkd3d/vkd3d_utils public exports.

When building natively on Linux we simply make those visibility default.

Nothing changes for standalone here.

Closes #152

Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-10-05 10:44:10 +02:00
Joshua Ashton e24914b11f include: Pull in Win32 Vulkan exts when building for Win32
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2020-07-06 19:29:30 +02:00
Józef Kucia 096dfde280 include: Document API 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-06-18 16:40:45 +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 3b83ccc67e vkd3d: Add stubs for versioned root signatures.
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:55 +02: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 be462a932f include: Use angle-bracket includes 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>
2018-11-08 19:07:36 +01:00
Józef Kucia f732501a14 include: Move vkd3d_result to common header.
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-08 19:07:34 +01:00
Józef Kucia c75f9ee39d vkd3d: Export vkd3d_get_dxgi_format() function.
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-29 14:48:45 +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 0e86a6b353 libs/vkd3d: Use HRESULT as preferred error code.
For consistency.

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:25 +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 bfd20ef1c8 libs/vkd3d: Add support for custom PRESENT state transitions.
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-30 14:10:55 +02: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 23b33e7b24 include: Add typedefs for vkd3d function pointers.
It makes easier to load vkd3d 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-02-06 21:35:31 +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 9075722128 libs/vkd3d: Implement internal reference counting for resources.
For swapchain back buffers.

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:22 +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 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 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 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 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 1fbacd5a09 include: Allow using libvkd3d with custom Vulkan headers.
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:14 +01:00
Józef Kucia 55025f7bec libs/vkd3d: Get rid of vkd3d_get_vk_queue().
Replaced by vkd3d_acquire_vk_queue().

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:12 +01:00
Józef Kucia 12ca2bbcf6 libs/vkd3d: Add thread-safe API for accessing Vulkan command 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>
2018-01-15 17:51:39 +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 abff3ca469 include: Prefix public header file names with vkd3d.
Prevents possible clashes when using vkd3d with external Win32 headers.

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>
2017-12-15 16:27:34 +01:00
Józef Kucia f8c20beede include: Do not use vkd3d Win32 headers when VKD3D_NO_WIN32_TYPES is defined.
Allows using vkd3d with other Win32 headers.

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>
2017-12-15 16:27:31 +01:00
Józef Kucia 879c9e43d1 libs/vkd3d: Do not export D3D12* functions.
Move them to libvkd3d-utils.
2017-12-12 13:12:47 +01:00
Henri Verbeet 3019a3e8f1 libs/vkd3d: Support both native and Win32 wchar_t. 2017-08-29 16:36:05 +02:00
Józef Kucia 84889646f6 Update license to LGPL v2.1. 2017-06-16 22:11:21 +02:00
Józef Kucia 4aab207b56 libs/vkd3d: Fix initial state transtion for swapchain images. 2016-10-25 13:23:18 +02:00
Henri Verbeet 6babf11214 libs/vkd3d: Export a function to get the Vulkan format from a DXGI format. 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