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

Subpass dependency.

Wraps a VkSubpassDependency2. This class is subsequently passed to a RenderPass, see its documentation for a high-level usage information.

Compatibility with VkSubpassDependency

While the class operates on the VkSubpassDependency2 structure that's new in Vulkan 1.2 or is provided by the KHR_create_renderpass2 extension, conversion from and to VkSubpassDependency is provided to some extent — you can create a SubpassDependency from it, call various methods on the instance and then get a VkSubpassDependency back again using vkSubpassDependency().

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

Please note that the conversion to VkSubpassDependency will ignore all fields that are present only in VkSubpassDependency2 — in particular, the whole pNext pointer chain is omitted. When performing the conversion it's your responsibility to ensure nothing significant was in the fields that were left out.

Public types

enum (anonymous): UnsignedInt { External = VK_SUBPASS_EXTERNAL }

Constructors, destructors, conversion operators

SubpassDependency(UnsignedInt sourceSubpass, UnsignedInt destinationSubpass, PipelineStages sourceStages, PipelineStages destinationStages, Accesses sourceAccesses, Accesses destinationAccesses, DependencyFlags flags = {}) explicit
Constructor.
SubpassDependency(NoInitT) explicit noexcept
Construct without initializing the contents.
SubpassDependency(const VkSubpassDependency2& dependency) explicit
Construct from existing data.
SubpassDependency(const VkSubpassDependency& dependency) explicit
Construct from a VkSubpassDependency
operator const VkSubpassDependency2*() const
operator const VkSubpassDependency2&() const

Public functions

auto operator*() -> VkSubpassDependency2&
Underlying VkSubpassDependency2 structure.
auto operator*() const -> const VkSubpassDependency2&
auto operator->() -> VkSubpassDependency2*
auto operator->() const -> const VkSubpassDependency2*
auto vkSubpassDependency() const -> VkSubpassDependency
Corresponding VkSubpassDependency structure.

Enum documentation

enum Magnum::Vk::SubpassDependency::(anonymous): UnsignedInt

Enumerators
External

Subpass index identifying an external dependency

Function documentation

Magnum::Vk::SubpassDependency::SubpassDependency(UnsignedInt sourceSubpass, UnsignedInt destinationSubpass, PipelineStages sourceStages, PipelineStages destinationStages, Accesses sourceAccesses, Accesses destinationAccesses, DependencyFlags flags = {}) explicit

Constructor.

Parameters
sourceSubpass Source subpass index or External
destinationSubpass Destination subpass index or External
sourceStages Source stages. Has to contain at least one stage.
destinationStages Destination stages. Has to contain at least one stage.
sourceAccesses Source memory access types participating in a dependency. Each has to be supported by at least one stage in sourceStages.
destinationAccesses Destination memory access types participating in a dependency. Each has to be supported by at least one stage in destinationStages.
flags Flags

The sourceSubpass has to be less than or equal to destinationSubpass to avoid cyclic dependencies and ensure a valid execution order. One of them (but not both) can be also External to specify an external dependency.

The sourceStages / destinationStages specify an execution dependency — what stages need to have finished execution before starting execution of the others — but alone isn't enough. The sourceAccesses and destinationAccesses then specify memory dependencies between the two sets — what memory operations need to be made available for the second set so it has everything it needs.

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

  • srcSubpass to sourceSubpass
  • dstSubpass to destinationSubpass
  • srcStageMask to sourceStages
  • dstStageMask to destinationStages
  • srcAccessMask to sourceAccesses
  • dstAccessMask to destinationAccesses
  • dependencyFlags to flags

Magnum::Vk::SubpassDependency::SubpassDependency(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::SubpassDependency::SubpassDependency(const VkSubpassDependency2& dependency) 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::SubpassDependency::SubpassDependency(const VkSubpassDependency& dependency) explicit

Construct from a VkSubpassDependency

Compared to the above, fills the common subset of VkSubpassDescription2, sets sType and zero-fills pNext and viewOffset.

Magnum::Vk::SubpassDependency::operator const VkSubpassDependency2*() const

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

Magnum::Vk::SubpassDependency::operator const VkSubpassDependency2&() const

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

The class is implicitly convertible to a reference in addition to a pointer because the type is commonly used in arrays as well, which would be annoying to do with a pointer conversion.

const VkSubpassDependency2& Magnum::Vk::SubpassDependency::operator*() const

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

VkSubpassDependency2* Magnum::Vk::SubpassDependency::operator->()

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

const VkSubpassDependency2* Magnum::Vk::SubpassDependency::operator->() const

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

VkSubpassDependency Magnum::Vk::SubpassDependency::vkSubpassDependency() const

Corresponding VkSubpassDependency structure.

Provided for compatibility with Vulkan implementations that don't support version 1.2 or the KHR_create_renderpass2 extension. See Compatibility with VkSubpassDependency for more information.