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

Descriptor set layout binding.

Wraps a VkDescriptorSetLayoutBinding together with associated VkDescriptorBindingFlags. See Descriptor set layout creation for usage information.

Public types

enum class Flag: UnsignedInt { UpdateAfterBind = VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, UpdateUnusedWhilePending = VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT, PartiallyBound = VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT, VariableDescriptorCount = VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT }
Descriptor set layout binding flag.
using Flags = Containers::EnumSet<Flag>
Descriptor set layout creation flags.

Constructors, destructors, conversion operators

DescriptorSetLayoutBinding(UnsignedInt binding, DescriptorType descriptorType, UnsignedInt descriptorCount = 1, ShaderStages stages = ~ShaderStages{}, Flags flags = {})
Constructor.
DescriptorSetLayoutBinding(UnsignedInt binding, DescriptorType descriptorType, Containers::ArrayView<const VkSampler> immutableSamplers, ShaderStages stages = ~ShaderStages{}, Flags flags = {})
Construct with immutable samplers.
DescriptorSetLayoutBinding(UnsignedInt binding, DescriptorType descriptorType, std::initializer_list<VkSampler> immutableSamplers, ShaderStages stages = ~ShaderStages{}, Flags flags = {})
DescriptorSetLayoutBinding(NoInitT) explicit noexcept
Construct without initializing the contents.
DescriptorSetLayoutBinding(const VkDescriptorSetLayoutBinding& info, VkDescriptorBindingFlags flags = {}) explicit
Construct from existing data.
DescriptorSetLayoutBinding(const DescriptorSetLayoutBinding&) deleted
Copying is not allowed.
DescriptorSetLayoutBinding(DescriptorSetLayoutBinding&& other) noexcept
Move constructor.
operator const VkDescriptorSetLayoutBinding*() const
operator const VkDescriptorSetLayoutBinding&() const

Public functions

auto operator=(const DescriptorSetLayoutBinding&) -> DescriptorSetLayoutBinding& deleted
Copying is not allowed.
auto operator=(DescriptorSetLayoutBinding&& other) -> DescriptorSetLayoutBinding& noexcept
Move assignment.
auto operator*() -> VkDescriptorSetLayoutBinding&
Underlying VkDescriptorSetLayoutBinding structure.
auto operator*() const -> const VkDescriptorSetLayoutBinding&
auto operator->() -> VkDescriptorSetLayoutBinding*
auto operator->() const -> const VkDescriptorSetLayoutBinding*
auto flags() -> VkDescriptorBindingFlags&
Underlying VkDescriptorBindingFlags enum set.
auto flags() const -> VkDescriptorBindingFlags

Enum documentation

enum class Magnum::Vk::DescriptorSetLayoutBinding::Flag: UnsignedInt

Descriptor set layout binding flag.

Wraps VkDescriptorBindingFlagBits.

Enumerators
UpdateAfterBind

If descriptors in this binding are updated between binding them in a command buffer and a Queue::submit(), the submission will use the most recently set descriptors for the binding and the updates do not invalidate the command buffer.

Descriptor set layouts using this flag can be only allocated from a DescriptorPool that has DescriptorPoolCreateInfo::Flag::UpdateAfterBind set as well.

UpdateUnusedWhilePending

Descriptors not used by the command buffer can be updated after binding them in a command buffer and while the command buffer is pending execution. If set together with Flag::PartiallyBound, any descriptors that are not dynamically used can be updated, if alone then only descriptors statically not used can be updated.

PartiallyBound

Descriptors in the binding that are not dynamically used don't need to contain valid descriptors when consumed.

VariableDescriptorCount

This descriptor binding has a variable size that will be specified in DescriptorPool::allocate(VkDescriptorSetLayout, UnsignedInt), and the descriptorCount value specified in the constructor is treated as an upper bound.

Allowed only on the last binding number in the layout, not allowed on a DescriptorType::UniformBufferDynamic or DescriptorType::StorageBufferDynamic.

Typedef documentation

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

Descriptor set layout creation flags.

Type-safe wrapper for VkDescriptorBindingFlags.

Function documentation

Magnum::Vk::DescriptorSetLayoutBinding::DescriptorSetLayoutBinding(UnsignedInt binding, DescriptorType descriptorType, UnsignedInt descriptorCount = 1, ShaderStages stages = ~ShaderStages{}, Flags flags = {})

Constructor.

Parameters
binding Binding corresponding to a particular binding in a shader. Has to be unique in the layout.
descriptorType Descriptor type
descriptorCount Number of descriptors contained in the binding. If the shader binding is not an array, use 1, zero is allowed as well. For a Flag::VariableDescriptorCount this is used as an upper bound and a concrete size is specified in DescriptorPool::allocate(VkDescriptorSetLayout, UnsignedInt).
stages Shader stages that access the binding. Use ~Vk::ShaderStages{} to specify that all stages may access the binding.
flags Flags

The following VkDescriptorSetLayoutBinding fields are pre-filled, everything else is zero-filled:

  • binding
  • descriptorType
  • descriptorCount
  • stageFlags to stages

If flags are non-empty, a VkDescriptorBindingFlags field is saved and then subsequently available through flags().

Magnum::Vk::DescriptorSetLayoutBinding::DescriptorSetLayoutBinding(UnsignedInt binding, DescriptorType descriptorType, Containers::ArrayView<const VkSampler> immutableSamplers, ShaderStages stages = ~ShaderStages{}, Flags flags = {})

Construct with immutable samplers.

Parameters
binding Binding corresponding to a particular binding in a shader
descriptorType Descriptor type. Should be either DescriptorType::Sampler or DescriptorType::CombinedImageSampler.
immutableSamplers Immutable samplers. Allowed to be empty.
stages Shader stages that access the binding. Use ~Vk::ShaderStages{} to specify that all stages may access the binding.
flags Flags

The following VkDescriptorSetLayoutBinding fields are pre-filled, everything else is zero-filled:

  • binding
  • descriptorType
  • descriptorCount to immutableSamplers.size()
  • pImmutableSamplers to a copy of immutableSamplers
  • stageFlags to stages

If flags are non-empty, a VkDescriptorBindingFlags field is saved and then subsequently available through flags().

Magnum::Vk::DescriptorSetLayoutBinding::DescriptorSetLayoutBinding(UnsignedInt binding, DescriptorType descriptorType, std::initializer_list<VkSampler> immutableSamplers, ShaderStages stages = ~ShaderStages{}, Flags flags = {})

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

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

Construct without initializing the contents.

Note that the structure has to be fully initialized afterwards in order to be usable.

Magnum::Vk::DescriptorSetLayoutBinding::DescriptorSetLayoutBinding(const VkDescriptorSetLayoutBinding& info, VkDescriptorBindingFlags flags = {}) 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::DescriptorSetLayoutBinding::operator const VkDescriptorSetLayoutBinding*() 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::DescriptorSetLayoutBinding::operator const VkDescriptorSetLayoutBinding&() 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 VkDescriptorSetLayoutBinding& Magnum::Vk::DescriptorSetLayoutBinding::operator*() const

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

VkDescriptorSetLayoutBinding* Magnum::Vk::DescriptorSetLayoutBinding::operator->()

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

const VkDescriptorSetLayoutBinding* Magnum::Vk::DescriptorSetLayoutBinding::operator->() const

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

VkDescriptorBindingFlags Magnum::Vk::DescriptorSetLayoutBinding::flags() const

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