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

Shader uniform pipeline layout descriptor. More...

#include <PipelineLayoutFlags.h>

Public Member Functions

 UniformDescriptor ()=default
 UniformDescriptor (StringLiteral name, UniformType type, std::uint32_t arraySize=0)
 Initializes the uniform descriptor with a name, type, and optional array size.

Public Attributes

StringLiteral name
 Specifies the name of an individual shader uniform. This must not be empty.
UniformType type = UniformType::Undefined
 Specifies the data type of the shader uniform. By default UniformType::Undefined.
std::uint32_t arraySize = 0
 Specifies the array size of the uniform. If this is 0, the uniform does not describe an array. By default 0.

Detailed Description

Shader uniform pipeline layout descriptor.

Remarks
Uniforms describe individual shader constants that have the same (i.e. uniform) value across all shader invocations for each draw and dispatch command.
For shader uniforms, no binding slot is specified. The backend determines the binding slot automatically via shader reflection for each pipeline state object (PSO).
See also
PipelineLayoutDescriptor::uniforms

Constructor & Destructor Documentation

◆ UniformDescriptor() [1/2]

LLGL::UniformDescriptor::UniformDescriptor ( )
default

◆ UniformDescriptor() [2/2]

LLGL::UniformDescriptor::UniformDescriptor ( StringLiteral name,
UniformType type,
std::uint32_t arraySize = 0 )
inline

Initializes the uniform descriptor with a name, type, and optional array size.

Member Data Documentation

◆ arraySize

std::uint32_t LLGL::UniformDescriptor::arraySize = 0

Specifies the array size of the uniform. If this is 0, the uniform does not describe an array. By default 0.

◆ name

StringLiteral LLGL::UniformDescriptor::name

Specifies the name of an individual shader uniform. This must not be empty.

Remarks
This describes the name of the uniform declaration itself and not its enclosing constant buffer if used inside a cbuffer (HLSL) or UBO (GLSL). That being said, chained identifiers are allowed if the unfiorm is wrapped inside a struct like in the following example:
struct Scene_t {
mat4 projection;
};
uniform Scene_t scene;
Here, the unfiorm needs to be addressed as "scene.projection". The ParseContext syntax even allows this to be written as "scene . projection" or any other whitespaces separating the identifiers.
See also
ParseContext::AsPipelineLayoutDesc

◆ type

UniformType LLGL::UniformDescriptor::type = UniformType::Undefined

Specifies the data type of the shader uniform. By default UniformType::Undefined.

Remarks
This describes the shader constant as scalar, vector, or matrix constant. When the pipeline layout is created, this field must have a valid uniform type, i.e. it must not be UniformType::Undefined.

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