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

Pipeline layout.

Wraps a VkPipelineLayout. Specifies what descriptor set layouts and push constants are used in a Pipeline.

Pipeline layout creation

Except for the rare case when your shader doesn't have any bindings, in which case a default-constructed PipelineLayoutCreateInfo would be enough, you'll want to list DescriptorSetLayout instances for all descriptor sets needed by shaders in the pipeline:

#include <Magnum/Vk/PipelineLayoutCreateInfo.h>



Vk::DescriptorSetLayout layout1{};
Vk::DescriptorSetLayout layout2{};


Vk::PipelineLayout{device, Vk::PipelineLayoutCreateInfo{
    layout1, layout2, 
}};

Pipeline layout usage

Once created, the pipeline layout instance is used for Pipeline creation and for descriptor set binding. See the corresponding class documentation for more information.

Public static functions

static auto wrap(Device& device, VkPipelineLayout handle, HandleFlags flags = {}) -> PipelineLayout
Wrap existing Vulkan handle.

Constructors, destructors, conversion operators

PipelineLayout(Device& device, const PipelineLayoutCreateInfo& info) explicit
Constructor.
PipelineLayout(NoCreateT) explicit
Construct without creating the pipeline layout.
PipelineLayout(const PipelineLayout&) deleted
Copying is not allowed.
PipelineLayout(PipelineLayout&& other) noexcept
Move constructor.
~PipelineLayout()
Destructor.
operator VkPipelineLayout()

Public functions

auto operator=(const PipelineLayout&) -> PipelineLayout& deleted
Copying is not allowed.
auto operator=(PipelineLayout&& other) -> PipelineLayout& noexcept
Move assignment.
auto handle() -> VkPipelineLayout
Underlying VkPipelineLayout handle.
auto handleFlags() const -> HandleFlags
Handle flags.
auto release() -> VkPipelineLayout
Release the underlying Vulkan pipeline layout.

Function documentation

static PipelineLayout Magnum::Vk::PipelineLayout::wrap(Device& device, VkPipelineLayout handle, HandleFlags flags = {})

Wrap existing Vulkan handle.

Parameters
device Vulkan device the pipeline layout is created on
handle The VkPipelineLayout handle
flags Handle flags

The handle is expected to be originating from device. Unlike a pipeline layout created using a constructor, the Vulkan pipeline layout is by default not deleted on destruction, use flags for different behavior.

Magnum::Vk::PipelineLayout::PipelineLayout(Device& device, const PipelineLayoutCreateInfo& info) explicit

Constructor.

Parameters
device Vulkan device to create the pipeline layout on
info Pipeline layout creation info

Magnum::Vk::PipelineLayout::PipelineLayout(NoCreateT) explicit

Construct without creating the pipeline layout.

The constructed instance is equivalent to moved-from state. Useful in cases where you will overwrite the instance later anyway. Move another object over it to make it useful.

Magnum::Vk::PipelineLayout::~PipelineLayout()

Destructor.

Destroys associated VkPipelineLayout handle, unless the instance was created using wrap() without HandleFlag::DestroyOnDestruction specified.

Magnum::Vk::PipelineLayout::operator VkPipelineLayout()

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

VkPipelineLayout Magnum::Vk::PipelineLayout::release()

Release the underlying Vulkan pipeline layout.

Releases ownership of the Vulkan pipeline layout and returns its handle so vkDestroyPipelineLayout() is not called on destruction. The internal state is then equivalent to moved-from state.