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

Buffer copy command.

Wraps a VkCopyBufferInfo2KHR. This class is subsequently used in CommandBuffer::copyBuffer(). See Copying buffer data for more information.

Compatibility with vkCmdCopyBuffer()

While the class operates on the VkCopyBufferInfo2KHR structure that's provided by the KHR_copy_commands2 extension, conversion from and to the set of parameters accepted by vkCmdCopyBuffer() is provided to some extent — you can create BufferCopy instances out of VkBufferCopy structures, pass them together with the rest to CopyBufferInfo and then get a VkBufferCopy list back again using vkBufferCopies().

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

Constructors, destructors, conversion operators

CopyBufferInfo(VkBuffer source, VkBuffer destination, Containers::ArrayView<const BufferCopy> regions)
Constructor.
CopyBufferInfo(VkBuffer source, VkBuffer destination, std::initializer_list<BufferCopy> regions)
CopyBufferInfo(NoInitT) explicit noexcept
Construct without initializing the contents.
CopyBufferInfo(const VkCopyBufferInfo2KHR& info) explicit
Construct from existing data.
operator const VkCopyBufferInfo2KHR*() const

Public functions

auto vkBufferCopies() const -> Containers::Array<VkBufferCopy>
Corresponding VkBufferCopy structures.
auto operator*() -> VkCopyBufferInfo2KHR&
Underlying VkCopyBufferInfo2KHR structure.
auto operator*() const -> const VkCopyBufferInfo2KHR&
auto operator->() -> VkCopyBufferInfo2KHR*
auto operator->() const -> const VkCopyBufferInfo2KHR*

Function documentation

Magnum::Vk::CopyBufferInfo::CopyBufferInfo(VkBuffer source, VkBuffer destination, Containers::ArrayView<const BufferCopy> regions)

Constructor.

Parameters
source Source Buffer or a raw Vulkan buffer handle. Expected to have been created with BufferUsage::TransferSource.
destination Destination Buffer or a raw Vulkan buffer handle. Expected to have been created with BufferUsage::TransferDestination.
regions Regions to copy. There has to be at least one.

Magnum::Vk::CopyBufferInfo::CopyBufferInfo(VkBuffer source, VkBuffer destination, std::initializer_list<BufferCopy> 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::CopyBufferInfo::CopyBufferInfo(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::CopyBufferInfo::CopyBufferInfo(const VkCopyBufferInfo2KHR& 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::CopyBufferInfo::operator const VkCopyBufferInfo2KHR*() 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<VkBufferCopy> Magnum::Vk::CopyBufferInfo::vkBufferCopies() const

Corresponding VkBufferCopy structures.

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

const VkCopyBufferInfo2KHR& Magnum::Vk::CopyBufferInfo::operator*() const

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

VkCopyBufferInfo2KHR* Magnum::Vk::CopyBufferInfo::operator->()

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

const VkCopyBufferInfo2KHR* Magnum::Vk::CopyBufferInfo::operator->() const

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