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

Static sampler state pipeline layout descriptor. More...

#include <PipelineLayoutFlags.h>

Public Member Functions

 StaticSamplerDescriptor ()=default
 StaticSamplerDescriptor (long stageFlags, const BindingSlot &slot, const SamplerDescriptor &sampler)
 Initializes the static sampler with stage flags, binding slot, and sampler state.
 StaticSamplerDescriptor (StringLiteral name, long stageFlags, const BindingSlot &slot, const SamplerDescriptor &sampler)
 Initializes the static sampler with a name, stage flags, binding slot, and sampler state.

Public Attributes

StringLiteral name
 Optional name for shading languages that do not support binding slots within the shader.
long stageFlags = 0
 Specifies which shader stages can access this static sampler. By default 0.
BindingSlot slot
 Specifies the binding slot of the static sampler.
SamplerDescriptor sampler
 Specifies the static sampler state.

Detailed Description

Static sampler state pipeline layout descriptor.

Remarks
Static samplers are part of a pipeline layout rather than a pipeline state. This is the equivalent of a static sampler in a root signature in Direct3D 12.
See also
PipelineLayoutDescriptor::staticSamplers

Constructor & Destructor Documentation

◆ StaticSamplerDescriptor() [1/3]

LLGL::StaticSamplerDescriptor::StaticSamplerDescriptor ( )
default

◆ StaticSamplerDescriptor() [2/3]

LLGL::StaticSamplerDescriptor::StaticSamplerDescriptor ( long stageFlags,
const BindingSlot & slot,
const SamplerDescriptor & sampler )
inline

Initializes the static sampler with stage flags, binding slot, and sampler state.

◆ StaticSamplerDescriptor() [3/3]

LLGL::StaticSamplerDescriptor::StaticSamplerDescriptor ( StringLiteral name,
long stageFlags,
const BindingSlot & slot,
const SamplerDescriptor & sampler )
inline

Initializes the static sampler with a name, stage flags, binding slot, and sampler state.

Member Data Documentation

◆ name

StringLiteral LLGL::StaticSamplerDescriptor::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".

◆ sampler

SamplerDescriptor LLGL::StaticSamplerDescriptor::sampler

Specifies the static sampler state.

Remarks
Static samplers can only use one of three predefined border colors:
  • Transparent black: {0,0,0,0}
  • Opaque black: {0,0,0,1}
  • Opaque white: {1,1,1,1}

◆ slot

BindingSlot LLGL::StaticSamplerDescriptor::slot

Specifies the binding slot of the static sampler.

◆ stageFlags

long LLGL::StaticSamplerDescriptor::stageFlags = 0

Specifies which shader stages can access this static sampler. By default 0.

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

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