LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::BindingSlot Struct Reference

Resource binding slot structure. More...

#include <PipelineLayoutFlags.h>

Public Member Functions

 BindingSlot ()=default
 BindingSlot (std::uint32_t index, std::uint32_t set=0)
 Constructs the binding slot with an index and an optional set (for Vulkan).

Public Attributes

std::uint32_t index = 0
 Specifies the zero-based binding index. By default 0.
std::uint32_t set = 0
 Specifies the zero-based descriptor set.

Detailed Description

Resource binding slot structure.

Remarks
This is used to unify the description of resource binding slots and sets.
See also
BindingDescriptor::slot

Constructor & Destructor Documentation

◆ BindingSlot() [1/2]

LLGL::BindingSlot::BindingSlot ( )
default

◆ BindingSlot() [2/2]

LLGL::BindingSlot::BindingSlot ( std::uint32_t index,
std::uint32_t set = 0 )
inline

Constructs the binding slot with an index and an optional set (for Vulkan).

Member Data Documentation

◆ index

std::uint32_t LLGL::BindingSlot::index = 0

Specifies the zero-based binding index. By default 0.

Remarks
For Vulkan, each binding must have a unique slot within the same pipeline layout unless they are in different descriptor sets.
It is recommended to not use the binding slot 0 for buffer bindings because it might overlap with implicitly assigned slots depending on the backend.
  • For Metal, shader resources and vertex buffers share the same binding table and LLGL binds vertex buffers starting from slot 0. If more than one vertex buffer is bound, all subsequent slots will also be occupied by those vertex buffers and pipeline resources must be bound after them.
  • For D3D11 and D3D12, the special constant buffer "$Globals" is implicitly assigned a binding slot. If no other resource is explicitly assigned binding slot 0, this constant buffer will be implicitly assigned slot 0. While other resources can occupy binding slot 0, this should match across all shader stages or the behavior is undefined.
See also
set

◆ set

std::uint32_t LLGL::BindingSlot::set = 0

Specifies the zero-based descriptor set.

Remarks
For Vulkan, each binding must have a unique slot within the same pipeline layout unless they are in different descriptor sets. LLGL will also re-assign these descriptor set indices according to the internal binding layout for the Vulkan backend, i.e. modify OpDecorate ID DescriptorSet SET SPIR-V instructions.
This field is silently ignored by backends that do not support binding sets, aka. register spaces.
Note
Only supported with: Vulkan, Direct3D 12.
See also
slot

The documentation for this struct was generated from the following file: