C Specification
To query if using VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT has a negative
impact on device performance when accessing an image, add
VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT to
VkPhysicalDeviceImageFormatInfo2::usage, and add a
VkHostImageCopyDevicePerformanceQueryEXT structure to the pNext
chain of a VkImageFormatProperties2 structure passed to
vkGetPhysicalDeviceImageFormatProperties2.
This structure is defined as:
// Provided by VK_EXT_host_image_copy
typedef struct VkHostImageCopyDevicePerformanceQueryEXT {
VkStructureType sType;
void* pNext;
VkBool32 optimalDeviceAccess;
VkBool32 identicalMemoryLayout;
} VkHostImageCopyDevicePerformanceQueryEXT;
Members
-
sTypeis a VkStructureType value identifying this structure. -
pNextisNULLor a pointer to a structure extending this structure. -
optimalDeviceAccessreturnsVK_TRUEif use of host image copy has no adverse effect on device access performance, compared to an image that is created with exact same creation parameters, and bound to the same VkDeviceMemory, except thatVK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXTis replaced withVK_IMAGE_USAGE_TRANSFER_SRC_BITandVK_IMAGE_USAGE_TRANSFER_DST_BIT. -
identicalMemoryLayoutreturnsVK_TRUEif use of host image copy has no impact on memory layout compared to an image that is created with exact same creation parameters, and bound to the same VkDeviceMemory, except thatVK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXTis replaced withVK_IMAGE_USAGE_TRANSFER_SRC_BITandVK_IMAGE_USAGE_TRANSFER_DST_BIT.
Description
The implementation may return VK_FALSE in optimalDeviceAccess
if identicalMemoryLayout is VK_FALSE.
If identicalMemoryLayout is VK_TRUE, optimalDeviceAccess
must be VK_TRUE.
The implementation may return VK_TRUE in optimalDeviceAccess
while identicalMemoryLayout is VK_FALSE.
In this situation, any device performance impact should not be measurable.
If VkPhysicalDeviceImageFormatInfo2::format is a
block-compressed format and vkGetPhysicalDeviceImageFormatProperties2
returns VK_SUCCESS, the implementation must return VK_TRUE in
optimalDeviceAccess.
|
Note
Applications can make use of |
|
Note
Layout not being identical yet still considered optimal for device access could happen if the implementation has different memory layout patterns, some of which are easier to access on the host. |
|
Note
The most practical reason for |
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.