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 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 ACCESS_HOST_WRITE_BIT or 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 the second access scope includes no access, as if dstAccessMask was 0.
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 the first access scope includes no access, as if srcAccessMask was 0.
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, when the old and new layout are equal, the layout values are ignored - data is preserved no matter what values are specified, or what layout the image is currently in.
If image has a multi-planar format and the image is disjoint, then including IMAGE_ASPECT_COLOR_BIT in the aspectMask member of subresourceRange is equivalent to including IMAGE_ASPECT_PLANE_0_BIT, IMAGE_ASPECT_PLANE_1_BIT, and (for three-plane formats only) IMAGE_ASPECT_PLANE_2_BIT.
srcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL then image must have been created with IMAGE_USAGE_COLOR_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL then image must have been created with IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL then image must have been created with IMAGE_USAGE_SAMPLED_BIT or IMAGE_USAGE_INPUT_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL then image must have been created with IMAGE_USAGE_TRANSFER_SRC_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL then image must have been created with IMAGE_USAGE_TRANSFER_DST_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, oldLayout must be IMAGE_LAYOUT_UNDEFINED or the current layout of the image subresources affected by the barriersrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, newLayout must not be IMAGE_LAYOUT_UNDEFINED or IMAGE_LAYOUT_PREINITIALIZEDsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL then image must have been created with IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL then image must have been created with at least one of IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, IMAGE_USAGE_SAMPLED_BIT, or IMAGE_USAGE_INPUT_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL then image must have been created with IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT setsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL then image must have been created with at least one of IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, IMAGE_USAGE_SAMPLED_BIT, or IMAGE_USAGE_INPUT_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL then image must have been created with IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT setsynchronization2 feature is not enabled, oldLayout must not be IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHRsynchronization2 feature is not enabled, newLayout must not be IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR or IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHRsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_ATTACHMENT_OPTIMAL, image must have been created with IMAGE_USAGE_COLOR_ATTACHMENT_BIT or IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_READ_ONLY_OPTIMAL, image must have been created with at least one of IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, IMAGE_USAGE_SAMPLED_BIT, or IMAGE_USAGE_INPUT_ATTACHMENT_BITsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR then image must have been created with IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR setimage was created with a sharing mode of SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not equal, srcQueueFamilyIndex must be QUEUE_FAMILY_EXTERNAL, QUEUE_FAMILY_FOREIGN_EXT, or a valid queue familyimage was created with a sharing mode of SHARING_MODE_EXCLUSIVE, and srcQueueFamilyIndex and dstQueueFamilyIndex are not equal, dstQueueFamilyIndex must be QUEUE_FAMILY_EXTERNAL, QUEUE_FAMILY_FOREIGN_EXT, or a valid queue familysrcQueueFamilyIndex is not equal to dstQueueFamilyIndex, at least one of srcQueueFamilyIndex or dstQueueFamilyIndex must not be QUEUE_FAMILY_EXTERNAL or QUEUE_FAMILY_FOREIGN_EXTVK_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 QUEUE_FAMILY_EXTERNALVK_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 QUEUE_FAMILY_EXTERNALVK_EXT_queue_family_foreign extension is not enabled srcQueueFamilyIndex must not be QUEUE_FAMILY_FOREIGN_EXTVK_EXT_queue_family_foreign extension is not enabled dstQueueFamilyIndex must not be QUEUE_FAMILY_FOREIGN_EXTsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_VIDEO_DECODE_SRC_KHR then image must have been created with IMAGE_USAGE_VIDEO_DECODE_SRC_BIT_KHRsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_VIDEO_DECODE_DST_KHR then image must have been created with IMAGE_USAGE_VIDEO_DECODE_DST_BIT_KHRsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_VIDEO_DECODE_DPB_KHR then image must have been created with IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHRsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_VIDEO_ENCODE_SRC_KHR then image must have been created with IMAGE_USAGE_VIDEO_ENCODE_SRC_BIT_KHRsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_VIDEO_ENCODE_DST_KHR then image must have been created with IMAGE_USAGE_VIDEO_ENCODE_DST_BIT_KHRsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR then image must have been created with IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHRsrcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define an image layout transition, and oldLayout or newLayout is IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT then image must have been created with either the IMAGE_USAGE_COLOR_ATTACHMENT_BIT or IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT usage bits, and the IMAGE_USAGE_INPUT_ATTACHMENT_BIT or IMAGE_USAGE_SAMPLED_BIT usage bits, and the IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT usage bitattachmentFeedbackLoopLayout feature is not enabled, newLayout must not be IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXTsubresourceRange.baseMipLevel must be less than the mipLevels specified in VkImageCreateInfo when image was createdsubresourceRange.levelCount is not REMAINING_MIP_LEVELS, subresourceRange.baseMipLevel + subresourceRange.levelCount must be less than or equal to the mipLevels specified in VkImageCreateInfo when image was createdsubresourceRange.baseArrayLayer must be less than the arrayLayers specified in VkImageCreateInfo when image was createdsubresourceRange.layerCount is not REMAINING_ARRAY_LAYERS, subresourceRange.baseArrayLayer + subresourceRange.layerCount must be less than or equal to the arrayLayers specified in VkImageCreateInfo when image was createdimage is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory objectimage has a color format that is single-plane, then the aspectMask member of subresourceRange must be IMAGE_ASPECT_COLOR_BITimage has a color format and is not disjoint, then the aspectMask member of subresourceRange must be IMAGE_ASPECT_COLOR_BITimage has a multi-planar format and the image is disjoint, then the aspectMask member of subresourceRange must include at least one multi-planar aspect mask bit or IMAGE_ASPECT_COLOR_BITimage has a depth/stencil format with both depth and stencil and the separateDepthStencilLayouts feature is enabled, then the aspectMask member of subresourceRange must include either or both IMAGE_ASPECT_DEPTH_BIT and IMAGE_ASPECT_STENCIL_BITimage has a depth/stencil format with both depth and stencil and the separateDepthStencilLayouts feature is not enabled, then the aspectMask member of subresourceRange must include both IMAGE_ASPECT_DEPTH_BIT and IMAGE_ASPECT_STENCIL_BITaspectMask member of subresourceRange includes IMAGE_ASPECT_DEPTH_BIT, oldLayout and newLayout must not be one of IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMALaspectMask member of subresourceRange includes IMAGE_ASPECT_STENCIL_BIT, oldLayout and newLayout must not be one of IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL or IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMALsynchronization2 feature is not enabled, and image was created with a sharing mode of SHARING_MODE_CONCURRENT, at least one of srcQueueFamilyIndex and dstQueueFamilyIndex must be QUEUE_FAMILY_IGNOREDsynchronization2 feature is not enabled, and image was created with a sharing mode of SHARING_MODE_CONCURRENT, srcQueueFamilyIndex must be QUEUE_FAMILY_IGNORED or QUEUE_FAMILY_EXTERNALsynchronization2 feature is not enabled, and image was created with a sharing mode of SHARING_MODE_CONCURRENT, dstQueueFamilyIndex must be QUEUE_FAMILY_IGNORED or QUEUE_FAMILY_EXTERNALsType must be STRUCTURE_TYPE_IMAGE_MEMORY_BARRIERpNext 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 VkSampleLocationsInfoEXTsType value of each struct in the pNext chain must be uniqueoldLayout must be a valid VkImageLayout valuenewLayout must be a valid VkImageLayout valueimage must be a valid VkImage handlesubresourceRange must be a valid VkImageSubresourceRange structureVkImageSubresourceRange, CmdPipelineBarrier, CmdWaitEvents
struct VkImageMemoryBarrier {
VkStructureType sType;
void const * pNext;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
VkImageLayout oldLayout;
VkImageLayout newLayout;
uint32_t srcQueueFamilyIndex;
uint32_t dstQueueFamilyIndex;
VkImage image;
VkImageSubresourceRange subresourceRange;
}
| Modifier and Type | Class and Description |
|---|---|
| public static class | VkImageMemoryBarrier.
An array of |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | ALIGNOF
The struct alignment in bytes. |
| public static final int | DSTACCESSMASK
The struct member offsets. |
| public static final int | DSTQUEUEFAMILYINDEX
The struct member offsets. |
| public static final int | IMAGE
The struct member offsets. |
| public static final int | NEWLAYOUT
The struct member offsets. |
| public static final int | OLDLAYOUT
The struct member offsets. |
| public static final int | PNEXT
The struct member offsets. |
| public static final int | SIZEOF
The struct size in bytes. |
| public static final int | SRCACCESSMASK
The struct member offsets. |
| public static final int | SRCQUEUEFAMILYINDEX
The struct member offsets. |
| public static final int | STYPE
The struct member offsets. |
| public static final int | SUBRESOURCERANGE
The struct member offsets. |
| Access | Constructor and Description |
|---|---|
| protected | |
| public | VkImageMemoryBarrier(ByteBuffer container)
Creates a |
| Modifier and Type | Method and Description |
|---|---|
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier. | calloc(int
the buffer capacity capacity)Returns a new |
| public static VkImageMemoryBarrier | calloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkImageMemoryBarrier. | calloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier. | |
| public static VkImageMemoryBarrier. | |
| protected VkImageMemoryBarrier | create(long
the struct memory address address, ByteBuffer an optional container buffer, to be referenced strongly by the struct instance. container)Implements abstract org. the constructor, but returns the exact type of the Struct subclass.
|
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier. | create(int
the buffer capacity capacity)Returns a new |
| public static VkImageMemoryBarrier. | create(long
the memory address address, int the buffer capacity capacity)Create a |
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier. | |
| public int | |
| public VkImageMemoryBarrier | |
| public int | |
| public VkImageMemoryBarrier | |
| public long | |
| public VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier. | malloc(int
the buffer capacity capacity)Returns a new |
| public static VkImageMemoryBarrier | malloc(MemoryStack
the stack from which to allocate stack)Returns a new |
| public static VkImageMemoryBarrier. | malloc(int
the buffer capacity capacity, MemoryStack the stack from which to allocate stack)Returns a new |
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier | |
| public static VkImageMemoryBarrier. | |
| public static VkImageMemoryBarrier. | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public int | |
| public VkImageMemoryBarrier | |
| public static long | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static long | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static int | |
| public static void | |
| public static VkImageSubresourceRange | |
| public static void | |
| public int | |
| public VkImageMemoryBarrier | |
| public long | |
| public VkImageMemoryBarrier | |
| public VkImageMemoryBarrier | pNext(VkExternalMemoryAcquireUnmodifiedEXT value)
Prepends the specified |
| public VkImageMemoryBarrier | pNext(VkSampleLocationsInfoEXT value)
Prepends the specified |
| public VkImageMemoryBarrier | set(int sType, long pNext, int srcAccessMask, int dstAccessMask, int oldLayout, int newLayout, int srcQueueFamilyIndex, int dstQueueFamilyIndex, long image, VkImageSubresourceRange subresourceRange)
Initializes this struct with the specified values. |
| public VkImageMemoryBarrier | Returns: this structthe source struct src)Copies the specified struct data to this struct. |
| public int | |
| public int | |
| public VkImageMemoryBarrier | |
| public int | |
| public VkImageMemoryBarrier | |
| public int | |
| public VkImageMemoryBarrier | |
| public VkImageMemoryBarrier | |
| public VkImageSubresourceRange | subresourceRange()
describes the image subresource range within |
| public VkImageMemoryBarrier | subresourceRange(VkImageSubresourceRange value)
Copies the specified |
| public VkImageMemoryBarrier | subresourceRange(Consumer<VkImageSubresourceRange> consumer)
Passes the |