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
-
sType
is the type of this structure. -
pNext
isNULL
or a pointer to an extension-specific 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
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
pNext
chain ofVkBufferCreateInfo
for the call tovkCreateBuffer
used to create the buffer being queried contained an instance ofVkExternalMemoryBufferCreateInfo
, and any of the handle types specified inVkExternalMemoryBufferCreateInfo
::handleTypes
requires dedicated allocation, as reported by vkGetPhysicalDeviceExternalBufferProperties inVkExternalBufferProperties
::externalMemoryProperties
::externalMemoryFeatures
, therequiresDedicatedAllocation
field 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
pNext
chain ofVkImageCreateInfo
for the call tovkCreateImage
used to create the image being queried contained an instance ofVkExternalMemoryImageCreateInfo
, and any of the handle types specified inVkExternalMemoryImageCreateInfo
::handleTypes
requires dedicated allocation, as reported by vkGetPhysicalDeviceImageFormatProperties2 inVkExternalImageFormatProperties
::externalMemoryProperties
::externalMemoryFeatures
, therequiresDedicatedAllocation
field 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.