## 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:

// 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 the type of this structure.

• pNext is NULL 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

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:

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:

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.

Valid Usage (Implicit)
• VUID-VkMemoryDedicatedRequirements-sType-sType
sType must be VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS

VkBool32, VkStructureType