C Specification
The VkMemoryDedicatedRequirements
structure is defined as:
// Provided by VK_VERSION_1_1
typedef struct VkMemoryDedicatedRequirements {
VkStructureType sType;
void* pNext;
VkBool32 prefersDedicatedAllocation;
VkBool32 requiresDedicatedAllocation;
} VkMemoryDedicatedRequirements;
or the equivalent
// Provided by VK_KHR_dedicated_allocation
typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR;
Members
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
prefersDedicatedAllocation
specifies that the implementation would prefer a dedicated allocation for this resource. The application is still free to suballocate the resource but it may get better performance if a dedicated allocation is used. -
requiresDedicatedAllocation
specifies that a dedicated allocation is required for this resource.
Description
To determine the dedicated allocation requirements of a buffer or image
or tensor
resource, add a VkMemoryDedicatedRequirements structure to the
pNext
chain of the VkMemoryRequirements2 structure passed as the
pMemoryRequirements
parameter of vkGetBufferMemoryRequirements2
or vkGetImageMemoryRequirements2,
or vkGetTensorMemoryRequirementsARM,
respectively.
Constraints on the values returned for buffer resources are:
-
requiresDedicatedAllocation
may beVK_TRUE
if thepNext
chain of VkBufferCreateInfo for the call tovkCreateBuffer
used to create the buffer being queried included a VkExternalMemoryBufferCreateInfo structure, and any of the handle types specified in VkExternalMemoryBufferCreateInfo::handleTypes
requires dedicated allocation, as reported by vkGetPhysicalDeviceExternalBufferProperties inVkExternalBufferProperties
::externalMemoryProperties.externalMemoryFeatures
. Otherwise,requiresDedicatedAllocation
will beVK_FALSE
. -
When the implementation sets
requiresDedicatedAllocation
toVK_TRUE
, it must also setprefersDedicatedAllocation
toVK_TRUE
. -
If
VK_BUFFER_CREATE_SPARSE_BINDING_BIT
was set in VkBufferCreateInfo::flags
whenbuffer
was created, then bothprefersDedicatedAllocation
andrequiresDedicatedAllocation
will beVK_FALSE
.
Constraints on the values returned for image resources are:
-
requiresDedicatedAllocation
may beVK_TRUE
if thepNext
chain of VkImageCreateInfo for the call to vkCreateImage used to create the image being queried included a VkExternalMemoryImageCreateInfo structure, and any of the handle types specified in VkExternalMemoryImageCreateInfo::handleTypes
requires dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2 inVkExternalImageFormatProperties
::externalMemoryProperties.externalMemoryFeatures
. -
requiresDedicatedAllocation
may beVK_TRUE
if the image’s tiling isVK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT
. -
requiresDedicatedAllocation
will otherwise beVK_FALSE
-
If
VK_IMAGE_CREATE_SPARSE_BINDING_BIT
was set in VkImageCreateInfo::flags
whenimage
was created, then bothprefersDedicatedAllocation
andrequiresDedicatedAllocation
will beVK_FALSE
.
Constraints on the values returned for tensor resources are:
-
requiresDedicatedAllocation
may beVK_TRUE
if thepNext
chain of VkTensorCreateInfoARM for the call tovkCreateTensorARM
used to create the tensor being queried included a VkExternalMemoryTensorCreateInfoARM structure, and any of the handle types specified in VkExternalMemoryTensorCreateInfoARM::handleTypes
requires dedicated allocation, as reported by vkGetPhysicalDeviceExternalTensorPropertiesARM inVkExternalTensorPropertiesARM
::externalMemoryProperties.externalMemoryFeatures
. -
requiresDedicatedAllocation
will otherwise beVK_FALSE
. -
When the implementation sets
requiresDedicatedAllocation
toVK_TRUE
, it must also setprefersDedicatedAllocation
toVK_TRUE
.
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.