vkd3d 1.15
The vkd3d 3D Graphics Library
 
Loading...
Searching...
No Matches
vkd3d_image_resource_create_info Struct Reference

A chained structure containing the parameters to create a D3D12 resource backed by a Vulkan image. More...

#include <vkd3d.h>

Data Fields

enum vkd3d_structure_type type
 Must be set to VKD3D_STRUCTURE_TYPE_IMAGE_RESOURCE_CREATE_INFO.
 
const void * next
 Optional pointer to a structure containing further parameters.
 
VkImage vk_image
 The Vulkan image that backs the resource.
 
D3D12_RESOURCE_DESC desc
 The resource description.
 
unsigned int flags
 A combination of zero or more flags.
 
D3D12_RESOURCE_STATES present_state
 This field specifies how to handle resource state D3D12_RESOURCE_STATE_PRESENT for the resource.
 

Detailed Description

A chained structure containing the parameters to create a D3D12 resource backed by a Vulkan image.

Field Documentation

◆ flags

unsigned int vkd3d_image_resource_create_info::flags

A combination of zero or more flags.

The valid flags are VKD3D_RESOURCE_INITIAL_STATE_TRANSITION and VKD3D_RESOURCE_PRESENT_STATE_TRANSITION.

◆ present_state

D3D12_RESOURCE_STATES vkd3d_image_resource_create_info::present_state

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.

The documentation for this struct was generated from the following file: