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

Image copy command.

Wraps a VkCopyImageInfo2KHR. This class is subsequently used in CommandBuffer::copyImage(). See Copying image data for more information.

Compatibility with vkCmdCopyImage()

While the class operates on the VkCopyImageInfo2KHR structure that's provided by the KHR_copy_commands2 extension, conversion from and to the set of parameters accepted by vkCmdCopyImage() is provided to some extent — you can create ImageCopy instances out of VkImageCopy structures, pass them together with the rest to CopyImageInfo and then get a VkImageCopy list back again using vkImageCopies().

For direct editing of the Vulkan structure, it's recommended to edit the VkCopyImageInfo2KHR fields and then perform the conversion instead of editing the resulting VkImageCopy list, as additional safety checks may be done during the conversion to ensure no information is lost.

Constructors, destructors, conversion operators

CopyImageInfo(VkImage source, ImageLayout sourceLayout, VkImage destination, ImageLayout destinationLayout, Containers::ArrayView<const ImageCopy> regions)
Constructor.
CopyImageInfo(VkImage source, ImageLayout sourceLayout, VkImage destination, ImageLayout destinationLayout, std::initializer_list<ImageCopy> regions)
CopyImageInfo(NoInitT) explicit noexcept
Construct without initializing the contents.
CopyImageInfo(const VkCopyImageInfo2KHR& info) explicit
Construct from existing data.
operator const VkCopyImageInfo2KHR*() const

Public functions

auto vkImageCopies() const -> Containers::Array<VkImageCopy>
Corresponding VkImageCopy structures.
auto operator*() -> VkCopyImageInfo2KHR&
Underlying VkCopyImageInfo2KHR structure.
auto operator*() const -> const VkCopyImageInfo2KHR&
auto operator->() -> VkCopyImageInfo2KHR*
auto operator->() const -> const VkCopyImageInfo2KHR*

Function documentation

Magnum::Vk::CopyImageInfo::CopyImageInfo(VkImage source, ImageLayout sourceLayout, VkImage destination, ImageLayout destinationLayout, Containers::ArrayView<const ImageCopy> regions)

Constructor.

Parameters
source Source Image or a raw Vulkan image handle. Expected to have been created with ImageUsage::TransferSource and a PixelFormat usable for transfer source.
sourceLayout Source image layout. Can be either ImageLayout::General or ImageLayout::TransferSource.
destination Destination Image or a raw Vulkan image handle. Expected to have been created with ImageUsage::TransferDestination and a PixelFormat usable for transfer destination.
destinationLayout Destination image layout. Can be either ImageLayout::General or ImageLayout::TransferDestination.
regions Regions to copy. THere has to be at least one.

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

  • srcImage to source
  • srcImageLayout to sourceLayout
  • dstImage to destination
  • dstImageLayout to destinationLayout
  • regionCount and pRegions to regions

Magnum::Vk::CopyImageInfo::CopyImageInfo(VkImage source, ImageLayout sourceLayout, VkImage destination, ImageLayout destinationLayout, std::initializer_list<ImageCopy> regions)

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

Magnum::Vk::CopyImageInfo::CopyImageInfo(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::CopyImageInfo::CopyImageInfo(const VkCopyImageInfo2KHR& info) 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::CopyImageInfo::operator const VkCopyImageInfo2KHR*() const

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

Containers::Array<VkImageCopy> Magnum::Vk::CopyImageInfo::vkImageCopies() const

Corresponding VkImageCopy structures.

Provided for compatibility with Vulkan implementations that don't support the KHR_copy_commands2 extension. See Compatibility with vkCmdCopyImage() for more information.

const VkCopyImageInfo2KHR& Magnum::Vk::CopyImageInfo::operator*() const

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

VkCopyImageInfo2KHR* Magnum::Vk::CopyImageInfo::operator->()

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

const VkCopyImageInfo2KHR* Magnum::Vk::CopyImageInfo::operator->() const

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