C Specification

The VkImageMemoryBarrier structure is defined as:

// Provided by VK_VERSION_1_0
typedef struct VkImageMemoryBarrier {
    VkStructureType            sType;
    const void*                pNext;
    VkAccessFlags              srcAccessMask;
    VkAccessFlags              dstAccessMask;
    VkImageLayout              oldLayout;
    VkImageLayout              newLayout;
    uint32_t                   srcQueueFamilyIndex;
    uint32_t                   dstQueueFamilyIndex;
    VkImage                    image;
    VkImageSubresourceRange    subresourceRange;
} VkImageMemoryBarrier;

Members

Description

The first access scope is limited to access to memory through the specified image subresource range, via access types in the source access mask specified by srcAccessMask. If srcAccessMask includes VK_ACCESS_HOST_WRITE_BIT, memory writes performed by that access type are also made visible, as that access type is not performed through a resource.

The second access scope is limited to access to memory through the specified image subresource range, via access types in the destination access mask specified by dstAccessMask. If dstAccessMask includes VK_ACCESS_HOST_WRITE_BIT or VK_ACCESS_HOST_READ_BIT, available memory writes are also made visible to accesses of those types, as those access types are not performed through a resource.

If srcQueueFamilyIndex is not equal to dstQueueFamilyIndex, and srcQueueFamilyIndex is equal to the current queue family, then the memory barrier defines a queue family release operation for the specified image subresource range, and if dependencyFlags did not include VK_DEPENDENCY_QUEUE_FAMILY_OWNERSHIP_TRANSFER_USE_ALL_STAGES_BIT_KHR, the second synchronization scope of the calling command does not apply to this operation.

If dstQueueFamilyIndex is not equal to srcQueueFamilyIndex, and dstQueueFamilyIndex is equal to the current queue family, then the memory barrier defines a queue family acquire operation for the specified image subresource range, and if dependencyFlags did not include VK_DEPENDENCY_QUEUE_FAMILY_OWNERSHIP_TRANSFER_USE_ALL_STAGES_BIT_KHR, the first synchronization scope of the calling command does not apply to this operation.

If the synchronization2 feature is not enabled or oldLayout is not equal to newLayout, oldLayout and newLayout define an image layout transition for the specified image subresource range.

If the synchronization2 feature is enabled, srcQueueFamilyIndex and dstQueueFamilyIndex are equal, and oldLayout and newLayout are also equal, the layout values are ignored and the image contents are preserved regardless of the values of oldLayout, newLayout, and the current layout of the image.

If image is a 3D image created with VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT and the maintenance9 feature is enabled, the baseArrayLayer and layerCount members of subresourceRange specify the subset of slices of the 3D image affected by the memory barrier, including the layout transition. Any slices of a 3D image not included in subresourceRange are not affected by the memory barrier and remain in their existing layout.

If image has a multi-planar format and the image is disjoint, then including VK_IMAGE_ASPECT_COLOR_BIT in the aspectMask member of subresourceRange is equivalent to including VK_IMAGE_ASPECT_PLANE_0_BIT, VK_IMAGE_ASPECT_PLANE_1_BIT, and (for three-plane formats only) VK_IMAGE_ASPECT_PLANE_2_BIT.

Valid Usage
Valid Usage (Implicit)
  • VUID-VkImageMemoryBarrier-sType-sType
    sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER

  • VUID-VkImageMemoryBarrier-pNext-pNext
    Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of VkExternalMemoryAcquireUnmodifiedEXT or VkSampleLocationsInfoEXT

  • VUID-VkImageMemoryBarrier-sType-unique
    The sType value of each structure in the pNext chain must be unique

  • VUID-VkImageMemoryBarrier-oldLayout-parameter
    oldLayout must be a valid VkImageLayout value

  • VUID-VkImageMemoryBarrier-newLayout-parameter
    newLayout must be a valid VkImageLayout value

  • VUID-VkImageMemoryBarrier-image-parameter
    image must be a valid VkImage handle

  • VUID-VkImageMemoryBarrier-subresourceRange-parameter
    subresourceRange must be a valid VkImageSubresourceRange structure

See Also

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 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0