Magnum::Vk::ImageMemoryBarrier class new in Git master

Memory barrier affecting a single image.

Wraps a VkImageMemoryBarrier. Compared to MemoryBarrier only affects a single image and additionally performs ImageLayout transitions. This class is subsequently used in CommandBuffer::pipelineBarrier(), see Copying image data for usage examples.

Constructors, destructors, conversion operators

ImageMemoryBarrier(Accesses sourceAccesses, Accesses destinationAccesses, ImageLayout oldLayout, ImageLayout newLayout, VkImage image, ImageAspects aspects, UnsignedInt layerOffset = 0, UnsignedInt layerCount = VK_REMAINING_ARRAY_LAYERS, UnsignedInt levelOffset = 0, UnsignedInt levelCount = VK_REMAINING_MIP_LEVELS)
Constructor.
ImageMemoryBarrier(Accesses sourceAccesses, Accesses destinationAccesses, ImageLayout oldLayout, ImageLayout newLayout, Image& image, UnsignedInt layerOffset = 0, UnsignedInt layerCount = VK_REMAINING_ARRAY_LAYERS, UnsignedInt levelOffset = 0, UnsignedInt levelCount = VK_REMAINING_MIP_LEVELS)
Construct with an implicit image aspect.
ImageMemoryBarrier(NoInitT) explicit noexcept
Construct without initializing the contents.
ImageMemoryBarrier(const VkImageMemoryBarrier& barrier) explicit
Construct from existing data.
operator const VkImageMemoryBarrier*() const

Public functions

auto operator*() -> VkImageMemoryBarrier&
Underlying VkImageMemoryBarrier structure.
auto operator*() const -> const VkImageMemoryBarrier&
auto operator->() -> VkImageMemoryBarrier*
auto operator->() const -> const VkImageMemoryBarrier*

Function documentation

Magnum::Vk::ImageMemoryBarrier::ImageMemoryBarrier(Accesses sourceAccesses, Accesses destinationAccesses, ImageLayout oldLayout, ImageLayout newLayout, VkImage image, ImageAspects aspects, UnsignedInt layerOffset = 0, UnsignedInt layerCount = VK_REMAINING_ARRAY_LAYERS, UnsignedInt levelOffset = 0, UnsignedInt levelCount = VK_REMAINING_MIP_LEVELS)

Constructor.

Parameters
sourceAccesses Source memory access types participating in a dependency. While allowed, passing Read accesses here is redundant — that's already taken care of by the stage execution dependency in CommandBuffer::pipelineBarrier().
destinationAccesses Destination memory access types participating in a dependency
oldLayout Old layout in an image layout transition
newLayout New layout in an image layout transition
image An Image or a raw Vulkan image handle affected by the barrier
aspects Image aspects affected by the barrier
layerOffset Offset to the first layer affected by the barrier
layerCount Layer count affected by the barrier
levelOffset Offset to the first mip level affected by the barrier
levelCount Mip level count affected by the barrier

The following VkImageMemoryBarrier fields are pre-filled in addition to sType, everything else is zero-filled:

  • srcAccessMask to sourceAccesses
  • dstAccessMask to destinationAccesses
  • oldLayout
  • newLayout
  • image
  • subresourceRange.aspectMask to aspects
  • subresourceRange.levelOffset to levelOffset
  • subresourceRange.levelCount to levelCount
  • subresourceRange.baseArrayLayer to layerOffset
  • subresourceRange.layerCount to layerCount

Magnum::Vk::ImageMemoryBarrier::ImageMemoryBarrier(Accesses sourceAccesses, Accesses destinationAccesses, ImageLayout oldLayout, ImageLayout newLayout, Image& image, UnsignedInt layerOffset = 0, UnsignedInt layerCount = VK_REMAINING_ARRAY_LAYERS, UnsignedInt levelOffset = 0, UnsignedInt levelCount = VK_REMAINING_MIP_LEVELS)

Construct with an implicit image aspect.

Compared to ImageMemoryBarrier(Accesses, Accesses, ImageLayout, ImageLayout, VkImage, ImageAspects, UnsignedInt, UnsignedInt, UnsignedInt, UnsignedInt) the ImageAspects are chosen implicitly using imageAspectsFor() from Image::format().

Magnum::Vk::ImageMemoryBarrier::ImageMemoryBarrier(NoInitT) explicit noexcept

Construct without initializing the contents.

Note that not even the sType field is set — the structure has to be fully initialized afterwards in order to be usable.

Magnum::Vk::ImageMemoryBarrier::ImageMemoryBarrier(const VkImageMemoryBarrier& barrier) explicit

Construct from existing data.

Copies the existing values verbatim, pointers are kept unchanged without taking over the ownership. Modifying the newly created instance will not modify the original data nor the pointed-to data.

Magnum::Vk::ImageMemoryBarrier::operator const VkImageMemoryBarrier*() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const VkImageMemoryBarrier& Magnum::Vk::ImageMemoryBarrier::operator*() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

VkImageMemoryBarrier* Magnum::Vk::ImageMemoryBarrier::operator->()

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

const VkImageMemoryBarrier* Magnum::Vk::ImageMemoryBarrier::operator->() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.