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

Render pass creation info.

Wraps a VkRenderPassCreateInfo2. See Render pass creation for usage information.

Compatibility with VkRenderPassCreateInfo

While the class operates on the VkRenderPassCreateInfo2 structure that's new in Vulkan 1.2 or is provided by the KHR_create_renderpass2 extension, conversion from and to VkRenderPassCreateInfo is provided to some extent -— you can create a RenderPassCreateInfo from it, call various methods on the instance and then get a VkRenderPassCreateInfo back again using vkRenderPassCreateInfo(). Note that, because of the nested data references, some internal pointers may still point to the originating instance, so be sure to keep it in scope for as long as needed.

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

Please note that the conversion to VkRenderPassCreateInfo will ignore all fields that are present only in VkRenderPassCreateInfo2 and its substructures — in particular, pCorrelatedViewMasks are omitted. When performing the conversion it's your responsibility to ensure nothing significant was in the fields that were left out.

Public types

enum class Flag: UnsignedInt { }
Render pass creation flag.
using Flags = Containers::EnumSet<Flag>
Render pass creation flags.

Constructors, destructors, conversion operators

RenderPassCreateInfo(Flags flags = {}) explicit
Constructor.
RenderPassCreateInfo(NoInitT) explicit noexcept
Construct without initializing the contents.
RenderPassCreateInfo(const VkRenderPassCreateInfo2& info) explicit
Construct from existing data.
RenderPassCreateInfo(const VkRenderPassCreateInfo& info) explicit
Construct from a VkRenderPassCreateInfo
RenderPassCreateInfo(const RenderPassCreateInfo&) deleted
Copying is not allowed.
RenderPassCreateInfo(RenderPassCreateInfo&& other) noexcept
Move constructor.
operator const VkRenderPassCreateInfo2*() const

Public functions

auto operator=(const RenderPassCreateInfo&) -> RenderPassCreateInfo& deleted
Copying is not allowed.
auto operator=(RenderPassCreateInfo&& other) -> RenderPassCreateInfo& noexcept
Move assignment.
auto setAttachments(Containers::ArrayView<const AttachmentDescription> attachments) -> RenderPassCreateInfo&
Set attachments.
auto setAttachments(std::initializer_list<AttachmentDescription> attachments) -> RenderPassCreateInfo&
auto addSubpass(SubpassDescription&& subpass) -> RenderPassCreateInfo&
Add a subpass.
auto setDependencies(Containers::ArrayView<const SubpassDependency> dependencies) -> RenderPassCreateInfo&
Set subpass dependencies.
auto setDependencies(std::initializer_list<SubpassDependency> dependencies) -> RenderPassCreateInfo&
auto operator*() -> VkRenderPassCreateInfo2&
Underlying VkShaderModuleCreateInfo structure.
auto operator*() const -> const VkRenderPassCreateInfo2&
auto operator->() -> VkRenderPassCreateInfo2*
auto operator->() const -> const VkRenderPassCreateInfo2*
auto vkRenderPassCreateInfo() const -> Containers::Array<VkRenderPassCreateInfo>
Corresponding VkRenderPassCreateInfo structure.

Enum documentation

enum class Magnum::Vk::RenderPassCreateInfo::Flag: UnsignedInt

Render pass creation flag.

Wraps VkRenderPassCreateFlagBits.

Typedef documentation

typedef Containers::EnumSet<Flag> Magnum::Vk::RenderPassCreateInfo::Flags

Render pass creation flags.

Type-safe wrapper for VkRenderPassCreateFlags.

Function documentation

Magnum::Vk::RenderPassCreateInfo::RenderPassCreateInfo(Flags flags = {}) explicit

Constructor.

Parameters
flags Render pass creation flags

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

  • flags

You need to call addSubpass() at least once for a valid setup.

Magnum::Vk::RenderPassCreateInfo::RenderPassCreateInfo(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::RenderPassCreateInfo::RenderPassCreateInfo(const VkRenderPassCreateInfo2& 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::RenderPassCreateInfo::RenderPassCreateInfo(const VkRenderPassCreateInfo& info) explicit

Construct from a VkRenderPassCreateInfo

Compared to the above, fills the common subset of VkRenderPassCreateInfo2, sets sType, zero-fills correlatedViewMaskCount and pCorrelatedViewMasks and then calls setAttachments(), addSubpass() and setDependencies() with instances created using AttachmentDescription::AttachmentDescription(const VkAttachmentDescription&), SubpassDescription::SubpassDescription(const VkSubpassDescription&) and SubpassDependency::SubpassDependency(const VkSubpassDependency&).

Magnum::Vk::RenderPassCreateInfo::operator const VkRenderPassCreateInfo2*() const

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

RenderPassCreateInfo& Magnum::Vk::RenderPassCreateInfo::setAttachments(Containers::ArrayView<const AttachmentDescription> attachments)

Set attachments.

Returns Reference to self (for method chaining)

Subsequent calls to this function will replace the previous set, not append to it.

The following VkRenderPassCreateInfo2 fields are set by this function:

  • attachmentCount and pAttachments to a copy of attachments

RenderPassCreateInfo& Magnum::Vk::RenderPassCreateInfo::setAttachments(std::initializer_list<AttachmentDescription> attachments)

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

RenderPassCreateInfo& Magnum::Vk::RenderPassCreateInfo::addSubpass(SubpassDescription&& subpass)

Add a subpass.

Returns Reference to self (for method chaining)

At least one subpass has to be added.

The following VkRenderPassCreateInfo2 fields are set by this function:

  • subpassCount to the count of subpasses added previously by this function plus 1
  • pSubpasses to an array containing all subpass descriptions added previously by this function together with subpass; ownership of associated SubpassDescription state is moved to the RenderPassCreateInfo instance

RenderPassCreateInfo& Magnum::Vk::RenderPassCreateInfo::setDependencies(Containers::ArrayView<const SubpassDependency> dependencies)

Set subpass dependencies.

Returns Reference to self (for method chaining)

Subsequent calls to this function will replace the previous set, not append to it.

The following VkRenderPassCreateInfo2 fields are set by this function:

  • dependencyCount and pDependencies to a copy of dependencies

RenderPassCreateInfo& Magnum::Vk::RenderPassCreateInfo::setDependencies(std::initializer_list<SubpassDependency> dependencies)

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

const VkRenderPassCreateInfo2& Magnum::Vk::RenderPassCreateInfo::operator*() const

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

VkRenderPassCreateInfo2* Magnum::Vk::RenderPassCreateInfo::operator->()

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

const VkRenderPassCreateInfo2* Magnum::Vk::RenderPassCreateInfo::operator->() 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<VkRenderPassCreateInfo> Magnum::Vk::RenderPassCreateInfo::vkRenderPassCreateInfo() const

Corresponding VkRenderPassCreateInfo structure.

Provided for compatibility with Vulkan implementations that don't support version 1.2 or the KHR_create_renderpass2 extension. Because the type references structures not present in VkRenderPassCreateInfo2, it's returned wrapped it in a single-item array with the extra data appended at the end of the allocation. Note that, however, some internal pointers such as pNext may still point to the originating RenderPassCreateInfo instance, the returned allocation is not completely standalone. See Compatibility with VkRenderPassCreateInfo for more information.