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

Layout structure for a single binding point of the pipeline layout descriptor. More...

#include <PipelineLayoutFlags.h>

Public Member Functions

 BindingDescriptor ()=default
 BindingDescriptor (ResourceType type, long bindFlags, long stageFlags, const BindingSlot &slot, std::uint32_t arraySize=0)
 Constructors with all primary attributes and a default value for a uniform array.
 BindingDescriptor (StringLiteral name, ResourceType type, long bindFlags, long stageFlags, const BindingSlot &slot, std::uint32_t arraySize=0)
 Constructors with all attributes.

Public Attributes

StringLiteral name
 Optional name for shading languages that do not support binding slots within the shader.
ResourceType type = ResourceType::Undefined
 Resource view type for this layout binding. By default ResourceType::Undefined.
long bindFlags = 0
 Specifies to which kind of resource slot the resource will be bound. By default 0.
long stageFlags = 0
 Specifies which shader stages can access this resource binding. By default 0.
BindingSlot slot
 Specifies the binding slot for the resource.
std::uint32_t arraySize = 0
 Specifies the number of binding slots for an array resource. By default 0.

Detailed Description

Layout structure for a single binding point of the pipeline layout descriptor.

See also
PipelineLayoutDescriptor::bindings
PipelineLayoutDescriptor::heapBindings

Constructor & Destructor Documentation

◆ BindingDescriptor() [1/3]

LLGL::BindingDescriptor::BindingDescriptor ( )
default

◆ BindingDescriptor() [2/3]

LLGL::BindingDescriptor::BindingDescriptor ( ResourceType type,
long bindFlags,
long stageFlags,
const BindingSlot & slot,
std::uint32_t arraySize = 0 )
inline

Constructors with all primary attributes and a default value for a uniform array.

◆ BindingDescriptor() [3/3]

LLGL::BindingDescriptor::BindingDescriptor ( StringLiteral name,
ResourceType type,
long bindFlags,
long stageFlags,
const BindingSlot & slot,
std::uint32_t arraySize = 0 )
inline

Constructors with all attributes.

Member Data Documentation

◆ arraySize

std::uint32_t LLGL::BindingDescriptor::arraySize = 0

Specifies the number of binding slots for an array resource. By default 0.

Remarks
This can only be used for heap bindings, not for individual bindings.
Note
For Vulkan, this number specifies the size of an array of resources (e.g. an array of uniform buffers).
See also
PipelineLayoutDescriptor::heapBindings

◆ bindFlags

long LLGL::BindingDescriptor::bindFlags = 0

Specifies to which kind of resource slot the resource will be bound. By default 0.

Remarks
Input and output binding flags cannot be used together when a resource is bound, e.g. a texture cannot be sampled while it is written to.
When a Buffer is bound to a constant buffer slot for instance, the binding flag BindFlags::ConstantBuffer is required. When a Texture is bound to a sampled texture slot, the binding flag BindFlags::Sampled is required and so on.
See also
BindFlags

◆ name

StringLiteral LLGL::BindingDescriptor::name

Optional name for shading languages that do not support binding slots within the shader.

Remarks
This is only used for the OpenGL backend, when the GLSL version does not support explicit binding points. If GLSL 420 or later is supported, this can be ignored and the binding points can be specified like this:
#version 420
layout(binding = 1) uniform sampler2D mySampler;
Otherwise, the name of the resource must be included in this binding descriptor, e.g. "mySampler".

◆ slot

BindingSlot LLGL::BindingDescriptor::slot

Specifies the binding slot for the resource.

◆ stageFlags

long LLGL::BindingDescriptor::stageFlags = 0

Specifies which shader stages can access this resource binding. By default 0.

Remarks
This can be a bitwise OR combination of the StageFlags bitmasks.
See also
StageFlags

◆ type

ResourceType LLGL::BindingDescriptor::type = ResourceType::Undefined

Resource view type for this layout binding. By default ResourceType::Undefined.


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