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

Rasterization pipeline creation info.

Wraps a VkGraphicsPipelineCreateInfo, along with

See Rasterization pipeline creation for usage information.

Public types

enum class Flag: UnsignedInt { DisableOptimization = VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT, AllowDerivatives = VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT, Derivative = VK_PIPELINE_CREATE_DERIVATIVE_BIT }
Rasterization pipeline creation flag.
using Flags = Containers::EnumSet<Flag>
Rasterization pipeline creation flags.

Constructors, destructors, conversion operators

RasterizationPipelineCreateInfo(const ShaderSet& shaderSet, const MeshLayout& meshLayout, VkPipelineLayout pipelineLayout, VkRenderPass renderPass, UnsignedInt subpass, UnsignedInt subpassColorAttachmentCount, Flags flags = {}) explicit
Constructor.
RasterizationPipelineCreateInfo(NoInitT) explicit noexcept
Construct without initializing the contents.
RasterizationPipelineCreateInfo(const VkGraphicsPipelineCreateInfo& info) explicit
Construct from existing data.
RasterizationPipelineCreateInfo(const RasterizationPipelineCreateInfo&) deleted
Copying is not allowed.
RasterizationPipelineCreateInfo(RasterizationPipelineCreateInfo&& other) noexcept
Move constructor.
operator const VkGraphicsPipelineCreateInfo*() const

Public functions

auto operator=(const RasterizationPipelineCreateInfo&) -> RasterizationPipelineCreateInfo& deleted
Copying is not allowed.
auto operator=(RasterizationPipelineCreateInfo&& other) -> RasterizationPipelineCreateInfo& noexcept
Move assignment.
auto setViewport(const Range3D& viewport, const Range2Di& scissor) -> RasterizationPipelineCreateInfo&
Set viewport and scissor rectangle.
auto setViewport(const Range3D& viewport) -> RasterizationPipelineCreateInfo&
Set viewport with an implicit scissor rectangle.
auto setViewport(const Range2D& viewport, const Range2Di& scissor) -> RasterizationPipelineCreateInfo&
Set viewport with an implicit depth range.
auto setViewport(const Range2D& viewport) -> RasterizationPipelineCreateInfo&
Set viewport with an implicit depth range and scissor rectangle.
auto setDynamicStates(const DynamicRasterizationStates& states) -> RasterizationPipelineCreateInfo&
Set dynamic states.
auto operator*() -> VkGraphicsPipelineCreateInfo&
Underlying VkGraphicsPipelineCreateInfo structure.
auto operator*() const -> const VkGraphicsPipelineCreateInfo&
auto operator->() -> VkGraphicsPipelineCreateInfo*
auto operator->() const -> const VkGraphicsPipelineCreateInfo*

Enum documentation

enum class Magnum::Vk::RasterizationPipelineCreateInfo::Flag: UnsignedInt

Rasterization pipeline creation flag.

Wraps the rasterization-related subset of VkPipelineCreateFlagBits.

Enumerators
DisableOptimization

Create the pipeline without optimization.

AllowDerivatives

Allow derivatives to be subsequently created from this pipeline.

Derivative

Derivative of a pipeline created earlier.

Typedef documentation

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

Rasterization pipeline creation flags.

Type-safe wrapper for the rasterization-related subset of VkPipelineCreateFlags.

Function documentation

Magnum::Vk::RasterizationPipelineCreateInfo::RasterizationPipelineCreateInfo(const ShaderSet& shaderSet, const MeshLayout& meshLayout, VkPipelineLayout pipelineLayout, VkRenderPass renderPass, UnsignedInt subpass, UnsignedInt subpassColorAttachmentCount, Flags flags = {}) explicit

Constructor.

Parameters
shaderSet Set of shaders to use for this pipeline
meshLayout Mesh layout to use in this pipeline
pipelineLayout A PipelineLayout or a raw Vulkan pipeline layout handle
renderPass A RenderPass or a raw Vulkan render pass handle
subpass Subpass index
subpassColorAttachmentCount Number of color attachments the subpass uses
flags Rasterization pipeline creation flags

Note that the shaderSet and meshLayout structure internals are referenced, not copied, and thus have to stay in scope until the Pipeline object is created.

The following VkGraphicsPipelineCreateInfo and substructure fields are pre-filled in addition to sType of all referenced structures, everything else is zero-filled:

You need to call at least setViewport() or specifying DynamicRasterizationState::Viewport in setDynamicStates() for a valid setup.

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

Construct without initializing the contents.

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

Magnum::Vk::RasterizationPipelineCreateInfo::RasterizationPipelineCreateInfo(const VkGraphicsPipelineCreateInfo& info) explicit

Construct from existing data.

Copies the existing values including the pointed-to

structures verbatim, remaining 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::RasterizationPipelineCreateInfo::operator const VkGraphicsPipelineCreateInfo*() const

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

RasterizationPipelineCreateInfo& Magnum::Vk::RasterizationPipelineCreateInfo::setViewport(const Range3D& viewport, const Range2Di& scissor)

Set viewport and scissor rectangle.

Parameters
viewport Viewport rectangle and depth range
scissor Scissor rectangle
Returns Reference to self (for method chaining)

While the scissor rectangle is full pixels, the viewport XY range can have sub-pixel precision. The depth should be in range $ [0.0, 1.0] $ .

The following VkGraphicsPipelineCreateInfo and substructure fields are modified, in addition to sType of newly referenced structures:

  • pViewportState
  • pViewportState->viewportCount to 1
  • pViewportState->pViewports[0] to viewport
  • pViewportState->scissorCount to 1
  • pViewportState->pScissors[0] to scissor

RasterizationPipelineCreateInfo& Magnum::Vk::RasterizationPipelineCreateInfo::setViewport(const Range3D& viewport)

Set viewport with an implicit scissor rectangle.

Equivalent to calling setViewport(const Range3D&, const Range2Di&) with scissor set to the Range3D::xy() part of viewport.

RasterizationPipelineCreateInfo& Magnum::Vk::RasterizationPipelineCreateInfo::setViewport(const Range2D& viewport, const Range2Di& scissor)

Set viewport with an implicit depth range.

Equivalent to calling setViewport(const Range3D&, const Range2Di&) with depth from 0.0f to 1.0f.

RasterizationPipelineCreateInfo& Magnum::Vk::RasterizationPipelineCreateInfo::setViewport(const Range2D& viewport)

Set viewport with an implicit depth range and scissor rectangle.

Equivalent to calling setViewport(const Range3D&, const Range2Di&) with depth from 0.0f to 1.0f and scissor same as viewport.

RasterizationPipelineCreateInfo& Magnum::Vk::RasterizationPipelineCreateInfo::setDynamicStates(const DynamicRasterizationStates& states)

Set dynamic states.

The following VkGraphicsPipelineCreateInfo and substructure fields are modified, in addition to sType of newly referenced structures:

  • pDynamicState
  • pDynamicState->dynamicStateCount to count of values enabled in states
  • pDynamicState->pDynamicStates to a list of VkDynamicState corresponding to DynamicRasterizationState values enabled in states

const VkGraphicsPipelineCreateInfo& Magnum::Vk::RasterizationPipelineCreateInfo::operator*() const

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

VkGraphicsPipelineCreateInfo* Magnum::Vk::RasterizationPipelineCreateInfo::operator->()

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

const VkGraphicsPipelineCreateInfo* Magnum::Vk::RasterizationPipelineCreateInfo::operator->() const

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