VKIMAGEMEMORYBARRIER(3)

NAME
VkImageMemoryBarrier - Structure specifying the parameters of an image memory barrier.

C SPECIFICATION

    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;

FIELDS

sType
    Structure type. Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER.

pNext
    Pointer to next structure in the structure chain when applicable.

outputMask
    Types of writes to the image to flush (see VkMemoryOutputFlags for more detail).

inputMask
    Types of reads from the image to invalidate (see VkMemoryInputFlags for more detail).

oldLayout
    Current layout the image is expected to be in (see VkImageLayout for more detail).

newLayout
    New layout the image should be transferred to (see VkImageLayout for more detail).

srcQueueFamilyIndex
    Identifies the source queue family to transfer ownership of the image from. A value of VK_QUEUE_FAMILY_IGNORED indicates that this member should be ignored.

dstQueueFamilyIndex
    Identifies the destination queue family to transfer ownership of the image to. A value of VK_QUEUE_FAMILY_IGNORED indicates that this member should be ignored.

image
    Image object the memory barrier applies to.

subresourceRange
    Sub-range of the image the memory barrier applies to.

DESCRIPTION

This structure specifies the parameters of an image memory barrier that can be passed in the ppMemBarriers parameter of vkCmdPipelineBarrier and vkCmdWaitEvents.

VALID USAGE

    • sType must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER

    • pNext must be NULL

    • srcAccessMask must be a valid combination of VkAccessFlagBits values

    • dstAccessMask must be a valid combination of VkAccessFlagBits values

    • oldLayout must be a valid VkImageLayout value

    • newLayout must be a valid VkImageLayout value

    • image must be a valid VkImage handle

    • subresourceRange must be a valid VkImageSubresourceRange structure

    • oldLayout must be VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_PREINITIALIZED or the current layout of the image region affected by the barrier

    • newLayout must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED

    • If image was created with a sharing mode of VK_SHARING_MODE_CONCURRENT, srcQueueFamilyIndex and dstQueueFamilyIndex must both be VK_QUEUE_FAMILY_IGNORED

    • If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, srcQueueFamilyIndex and dstQueueFamilyIndex must either both be VK_QUEUE_FAMILY_IGNORED, or both be a valid queue family (see ???)

    • If image was created with a sharing mode of VK_SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are valid queue families, at least one of them must be the same as the family of the queue that will execute this barrier

    • subresourceRange must be a valid image subresource range for the image (see ???)

    • If image has a depth/stencil format with both depth and stencil components, then aspectMask member of subresourceRange must include both VK_IMAGE_ASPECT_DEPTH_BIT and VK_IMAGE_ASPECT_STENCIL_BIT

    • If either oldLayout or newLayout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT set

    • If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set

    • If either oldLayout or newLayout is VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT set

    • If either oldLayout or newLayout is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then image must have been created with VK_IMAGE_USAGE_SAMPLED_BIT or VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT set

    • If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT set

    • If either oldLayout or newLayout is VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT set

SEE ALSO

vkCmdPipelineBarrier, vkCmdWaitEvents, VkMemoryBarrier, VkBufferMemoryBarrier

COPYRIGHT

Copyright © 2014-2016 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

AUTHOR

Khronos Group
    Author.