VkBufferMemoryBarrier(3)

# VkBufferMemoryBarrier(3) Manual Page

## Name

VkBufferMemoryBarrier - Structure specifying a buffer memory barrier

## C Specification

The `VkBufferMemoryBarrier` structure is defined as:

Warning | This functionality is superseded by VkBufferMemoryBarrier2. See Legacy Functionality for more information.

    // Provided by VK_VERSION_1_0
    typedef struct VkBufferMemoryBarrier {
        VkStructureType    sType;
        const void*        pNext;
        VkAccessFlags      srcAccessMask;
        VkAccessFlags      dstAccessMask;
        uint32_t           srcQueueFamilyIndex;
        uint32_t           dstQueueFamilyIndex;
        VkBuffer           buffer;
        VkDeviceSize       offset;
        VkDeviceSize       size;
    } VkBufferMemoryBarrier;

## Members

- `sType` is a VkStructureType value identifying this structure.

- `pNext` is `NULL` or a pointer to a structure extending this structure.

- `srcAccessMask` is a bitmask of VkAccessFlagBits specifying a source access mask.

- `dstAccessMask` is a bitmask of VkAccessFlagBits specifying a destination access mask.

- `srcQueueFamilyIndex` is the source queue family for a queue family ownership transfer.

- `dstQueueFamilyIndex` is the destination queue family for a queue family ownership transfer.

- `buffer` is a handle to the buffer whose backing memory is affected by the barrier.

- `offset` is an offset in bytes into the backing memory for `buffer`; this is relative to the base offset as bound to the buffer (see vkBindBufferMemory).

- `size` is a size in bytes of the affected area of backing memory for `buffer`, or VK_WHOLE_SIZE to use the range from `offset` to the end of the buffer.

## Description

The first access scope is limited to access to memory through the specified buffer range, via access types in the source access mask specified by `srcAccessMask` and, if a VkMemoryBarrierAccessFlags3KHR is passed in `pNext`, `srcAccessMask3`. If the source access mask includes VK_ACCESS_HOST_WRITE_BIT, a memory domain operation is performed where available memory in the host domain is also made available to the device domain.

The second access scope is limited to access to memory through the specified buffer range, via access types in the destination access mask specified by `dstAccessMask` and, if a VkMemoryBarrierAccessFlags3KHR is passed in `pNext`, `dstAccessMask3`. If the destination access mask includes VK_ACCESS_HOST_WRITE_BIT or VK_ACCESS_HOST_READ_BIT, a memory domain operation is performed where available memory in the device domain is also made available to the host domain.

Note | Host writes to device memory that was allocated without VK_MEMORY_PROPERTY_HOST_COHERENT_BIT have to be flushed with vkFlushMappedMemoryRanges before they can be accessed safely on the device. Similarly, device writes to such memory have to be invalidated with vkInvalidateMappedMemoryRanges before they can be accessed safely on the host. Memory allocated with VK_MEMORY_PROPERTY_HOST_COHERENT_BIT does not need to have these additional operations performed.

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 buffer 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 buffer 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.

Valid Usage

- VUID-VkBufferMemoryBarrier-offset-01187
  `offset` must be less than the size of `buffer`

- VUID-VkBufferMemoryBarrier-size-01188
  If `size` is not equal to VK_WHOLE_SIZE, `size` must be greater than `0`

- VUID-VkBufferMemoryBarrier-size-01189
  If `size` is not equal to VK_WHOLE_SIZE, `size` must be less than or equal to than the size of `buffer` minus `offset`

- VUID-VkBufferMemoryBarrier-buffer-01931
  If `buffer` is non-sparse then it must be bound completely and contiguously to a single `VkDeviceMemory` object

- VUID-VkBufferMemoryBarrier-buffer-09095
  If `buffer` was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and `srcQueueFamilyIndex` and `dstQueueFamilyIndex` are not equal, `srcQueueFamilyIndex` must be VK_QUEUE_FAMILY_EXTERNAL, VK_QUEUE_FAMILY_FOREIGN_EXT, or a valid queue family

- VUID-VkBufferMemoryBarrier-buffer-09096
  If `buffer` was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and `srcQueueFamilyIndex` and `dstQueueFamilyIndex` are not equal, `dstQueueFamilyIndex` must be VK_QUEUE_FAMILY_EXTERNAL, VK_QUEUE_FAMILY_FOREIGN_EXT, or a valid queue family

- VUID-VkBufferMemoryBarrier-None-09097
  If the VK_KHR_external_memory extension is not enabled, and the value of VkApplicationInfo::`apiVersion` used to create the VkInstance is not greater than or equal to Version 1.1, `srcQueueFamilyIndex` must not be VK_QUEUE_FAMILY_EXTERNAL

- VUID-VkBufferMemoryBarrier-None-09098
  If the VK_KHR_external_memory extension is not enabled, and the value of VkApplicationInfo::`apiVersion` used to create the VkInstance is not greater than or equal to Version 1.1, `dstQueueFamilyIndex` must not be VK_QUEUE_FAMILY_EXTERNAL

- VUID-VkBufferMemoryBarrier-srcQueueFamilyIndex-09099
  If the VK_EXT_queue_family_foreign extension is not enabled `srcQueueFamilyIndex` must not be VK_QUEUE_FAMILY_FOREIGN_EXT

- VUID-VkBufferMemoryBarrier-dstQueueFamilyIndex-09100
  If the VK_EXT_queue_family_foreign extension is not enabled `dstQueueFamilyIndex` must not be VK_QUEUE_FAMILY_FOREIGN_EXT

- VUID-VkBufferMemoryBarrier-None-09049
  If the `synchronization2` feature is not enabled, and `buffer` was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, at least one of `srcQueueFamilyIndex` and `dstQueueFamilyIndex` must be VK_QUEUE_FAMILY_IGNORED

- VUID-VkBufferMemoryBarrier-None-09050
  If the `synchronization2` feature is not enabled, and `buffer` was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, `srcQueueFamilyIndex` must be VK_QUEUE_FAMILY_IGNORED or VK_QUEUE_FAMILY_EXTERNAL

- VUID-VkBufferMemoryBarrier-None-09051
  If the `synchronization2` feature is not enabled, and `buffer` was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, `dstQueueFamilyIndex` must be VK_QUEUE_FAMILY_IGNORED or VK_QUEUE_FAMILY_EXTERNAL

Valid Usage (Implicit)

- VUID-VkBufferMemoryBarrier-sType-sType
  `sType` must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER

- VUID-VkBufferMemoryBarrier-pNext-pNext
  `pNext` must be `NULL` or a pointer to a valid instance of VkExternalMemoryAcquireUnmodifiedEXT

- VUID-VkBufferMemoryBarrier-sType-unique
  The `sType` value of each structure in the `pNext` chain must be unique

- VUID-VkBufferMemoryBarrier-buffer-parameter
  `buffer` must be a valid VkBuffer handle

## See Also

VK_VERSION_1_0, VkAccessFlags, VkBuffer, VkDeviceSize, VkStructureType, vkCmdPipelineBarrier, vkCmdWaitEvents

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

SPDX-License-Identifier: CC-BY-4.0