Module: vkd3d
Branch: master
Commit: 3f43d06f5c67d4753100e0897bc2cc5f7c61f502
URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/3f43d06f5c67d4753100e0897bc2c…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Sun Apr 21 21:58:02 2024 +0200
include: Document structure vkd3d_image_resource_create_info.
---
include/vkd3d.h | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/include/vkd3d.h b/include/vkd3d.h
index 6b44b3c8..7f585aa2 100644
--- a/include/vkd3d.h
+++ b/include/vkd3d.h
@@ -313,18 +313,58 @@ struct vkd3d_optional_device_extensions_info
uint32_t extension_count;
};
-/* vkd3d_image_resource_create_info flags */
+/**
+ * When specified as a flag of vkd3d_image_resource_create_info, it means that vkd3d will do the
+ * initial transition operation on the image from VK_IMAGE_LAYOUT_UNDEFINED to its appropriate
+ * Vulkan layout (depending on its D3D12 resource state). If this flag is not specified the caller
+ * is responsible for transitioning the Vulkan image to the appropriate layout.
+ */
#define VKD3D_RESOURCE_INITIAL_STATE_TRANSITION 0x00000001
+/**
+ * When specified as a flag of vkd3d_image_resource_create_info, it means that field present_state
+ * is honored.
+ */
#define VKD3D_RESOURCE_PRESENT_STATE_TRANSITION 0x00000002
+/**
+ * A chained structure containing the parameters to create a D3D12 resource backed by a Vulkan
+ * image.
+ */
struct vkd3d_image_resource_create_info
{
+ /** Must be set to VKD3D_STRUCTURE_TYPE_IMAGE_RESOURCE_CREATE_INFO. */
enum vkd3d_structure_type type;
+ /** Optional pointer to a structure containing further parameters. */
const void *next;
+ /** The Vulkan image that backs the resource. */
VkImage vk_image;
+ /** The resource description. */
D3D12_RESOURCE_DESC desc;
+ /**
+ * A combination of zero or more flags. The valid flags are
+ * VKD3D_RESOURCE_INITIAL_STATE_TRANSITION and VKD3D_RESOURCE_PRESENT_STATE_TRANSITION.
+ */
unsigned int flags;
+ /**
+ * This field specifies how to handle resource state D3D12_RESOURCE_STATE_PRESENT for
+ * the resource. Notice that on D3D12 there is no difference between
+ * D3D12_RESOURCE_STATE_COMMON and D3D12_RESOURCE_STATE_PRESENT (they have the same value),
+ * while on Vulkan two different layouts are used (VK_IMAGE_LAYOUT_GENERAL and
+ * VK_IMAGE_LAYOUT_PRESENT_SRC_KHR).
+ *
+ * * When flag VKD3D_RESOURCE_PRESENT_STATE_TRANSITION is not specified, field
+ * present_state is ignored and resource state D3D12_RESOURCE_STATE_COMMON/_PRESENT is
+ * mapped to VK_IMAGE_LAYOUT_GENERAL; this is useful for non-swapchain resources.
+ * * Otherwise, when present_state is D3D12_RESOURCE_STATE_PRESENT/_COMMON, resource state
+ * D3D12_RESOURCE_STATE_COMMON/_PRESENT is mapped to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+ * this is useful for swapchain resources that are directly backed by a Vulkan swapchain
+ * image.
+ * * Otherwise, resource state D3D12_RESOURCE_STATE_COMMON/_PRESENT is treated as resource
+ * state present_state; this is useful for swapchain resources that backed by a Vulkan
+ * non-swapchain image, which the client will likely consume with a copy or drawing
+ * operation at presentation time.
+ */
D3D12_RESOURCE_STATES present_state;
};
Module: vkd3d
Branch: master
Commit: 2b1abc5d7bd9c4053d321e999c98d129ad708659
URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/2b1abc5d7bd9c4053d321e999c98d…
Author: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Date: Sun Apr 21 19:42:14 2024 +0200
include: Document structure vkd3d_device_create_info.
---
include/vkd3d.h | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/include/vkd3d.h b/include/vkd3d.h
index c350c5ea..b8584b68 100644
--- a/include/vkd3d.h
+++ b/include/vkd3d.h
@@ -237,22 +237,56 @@ struct vkd3d_host_time_domain_info
uint64_t ticks_per_second;
};
+/**
+ * A chained structure containing device creation parameters.
+ */
struct vkd3d_device_create_info
{
+ /** Must be set to VKD3D_STRUCTURE_TYPE_DEVICE_CREATE_INFO. */
enum vkd3d_structure_type type;
+ /** Optional pointer to a structure containing further parameters. */
const void *next;
+ /** The minimum feature level to request. Device creation will fail with E_INVALIDARG if the
+ * Vulkan device doesn't have the features needed to fulfill the request. */
D3D_FEATURE_LEVEL minimum_feature_level;
+ /**
+ * The vkd3d instance to use to create a device. Either this or instance_create_info must be
+ * set.
+ */
struct vkd3d_instance *instance;
+ /**
+ * The parameters used to create an instance, which is then used to create a device. Either
+ * this or instance must be set.
+ */
const struct vkd3d_instance_create_info *instance_create_info;
+ /**
+ * The Vulkan physical device to use. If it is NULL, the first physical device found is used,
+ * prioritizing discrete GPUs over integrated GPUs and integrated GPUs over all the others.
+ *
+ * This parameter can be overridden by setting environment variable VKD3D_VULKAN_DEVICE.
+ */
VkPhysicalDevice vk_physical_device;
+ /**
+ * A list of Vulkan device extensions to request. They are intended as required, so device
+ * creation will fail if any of them is not available.
+ */
const char * const *device_extensions;
+ /** The number of elements in the device_extensions array. */
uint32_t device_extension_count;
+ /**
+ * An object to be set as the device parent. This is not used by vkd3d except for being
+ * returned by vkd3d_get_device_parent.
+ */
IUnknown *parent;
+ /**
+ * The adapter LUID to be set for the device. This is not used by vkd3d except for being
+ * returned by GetAdapterLuid.
+ */
LUID adapter_luid;
};