C Specification
To determine the dedicated allocation requirements of a buffer or image
resource, add a VkMemoryDedicatedRequirements structure to the
pNext chain of the VkMemoryRequirements2 structure passed as the
pMemoryRequirements parameter of vkGetBufferMemoryRequirements2
or vkGetImageMemoryRequirements2.
The VkMemoryDedicatedRequirements structure is defined as:
typedef struct VkMemoryDedicatedRequirements {
VkStructureType sType;
void* pNext;
VkBool32 prefersDedicatedAllocation;
VkBool32 requiresDedicatedAllocation;
} VkMemoryDedicatedRequirements;
or the equivalent
typedef VkMemoryDedicatedRequirements VkMemoryDedicatedRequirementsKHR;
Members
-
sTypeis the type of this structure. -
pNextisNULLor a pointer to an extension-specific structure. -
prefersDedicatedAllocationspecifies 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. -
requiresDedicatedAllocationspecifies that a dedicated allocation is required for this resource.
Description
When the implementation sets requiresDedicatedAllocation to
VK_TRUE, it must also set prefersDedicatedAllocation to
VK_TRUE.
If the VkMemoryDedicatedRequirements structure is included in the
pNext chain of the VkMemoryRequirements2 structure passed as the
pMemoryRequirements parameter of a
vkGetBufferMemoryRequirements2 call, requiresDedicatedAllocation
may be VK_TRUE under one of the following conditions:
-
The
pNextchain ofVkBufferCreateInfofor the call tovkCreateBufferused to create the buffer being queried contained an instance ofVkExternalMemoryBufferCreateInfo, and any of the handle types specified inVkExternalMemoryBufferCreateInfo::handleTypesrequires dedicated allocation, as reported by vkGetPhysicalDeviceExternalBufferProperties inVkExternalBufferProperties::externalMemoryProperties::externalMemoryFeatures, therequiresDedicatedAllocationfield will be set toVK_TRUE.
In all other cases, requiresDedicatedAllocation must be set to
VK_FALSE by the implementation whenever a
VkMemoryDedicatedRequirements structure is included in the pNext
chain of the VkMemoryRequirements2 structure passed to a call to
vkGetBufferMemoryRequirements2.
If the VkMemoryDedicatedRequirements structure is included in the
pNext chain of the VkMemoryRequirements2 structure passed as the
pMemoryRequirements parameter of a
vkGetBufferMemoryRequirements2 call and
VK_BUFFER_CREATE_SPARSE_BINDING_BIT was set in
VkBufferCreateInfo::flags when buffer was created then the
implementation must set both prefersDedicatedAllocation and
requiresDedicatedAllocation to VK_FALSE.
If the VkMemoryDedicatedRequirements structure is included in the
pNext chain of the VkMemoryRequirements2 structure passed as the
pMemoryRequirements parameter of a vkGetImageMemoryRequirements2
call, requiresDedicatedAllocation may be VK_TRUE under one of
the following conditions:
-
The
pNextchain ofVkImageCreateInfofor the call tovkCreateImageused to create the image being queried contained an instance ofVkExternalMemoryImageCreateInfo, and any of the handle types specified inVkExternalMemoryImageCreateInfo::handleTypesrequires dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2 inVkExternalImageFormatProperties::externalMemoryProperties::externalMemoryFeatures, therequiresDedicatedAllocationfield will be set toVK_TRUE.
In all other cases, requiresDedicatedAllocation must be set to
VK_FALSE by the implementation whenever a
VkMemoryDedicatedRequirements structure is included in the pNext
chain of the VkMemoryRequirements2 structure passed to a call to
vkGetImageMemoryRequirements2.
If the VkMemoryDedicatedRequirements structure is included in the
pNext chain of the VkMemoryRequirements2 structure passed as the
pMemoryRequirements parameter of a vkGetImageMemoryRequirements2
call and VK_IMAGE_CREATE_SPARSE_BINDING_BIT was set in
VkImageCreateInfo::flags when image was created then the
implementation must set both prefersDedicatedAllocation and
requiresDedicatedAllocation to VK_FALSE.
See Also
VkBool32, VkStructureType
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.
Copyright
Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.