LiteFX 0.5.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Rendering::PipelineBindingHint Struct Reference

A hint used during shader reflection to control the pipeline layout. More...

#include <rendering_api.hpp>

Classes

struct  DescriptorHeapHint
 Defines a hint that is used to initialize a dynamic descriptor heap. More...
 
struct  PushConstantsHint
 Defines a hint that is used to mark a push constants range. More...
 
struct  ShaderStageHint
 Defines a hint that is used to mark additional a binding as used by certain shader stages. More...
 
struct  StaticSamplerHint
 Defines a hint that is used to bind a static sampler state to a sampler descriptor. More...
 
struct  UnboundedArrayHint
 Defines a hint that is used to mark an unbounded descriptor array. More...
 

Public Types

using hint_type = Variant<std::monostate, UnboundedArrayHint, PushConstantsHint, StaticSamplerHint, DescriptorHeapHint, ShaderStageHint>
 Defines the type of the pipeline binding hint.
 

Static Public Member Functions

static auto runtimeArray (DescriptorBindingPoint at, UInt32 maxDescriptors) noexcept -> PipelineBindingHint
 Initializes a hint that binds an unbounded runtime array.
 
static auto runtimeArray (UInt32 space, UInt32 binding, UInt32 maxDescriptors) noexcept -> PipelineBindingHint
 Initializes a hint that binds an unbounded runtime array.
 
static auto pushConstants (DescriptorBindingPoint at) noexcept -> PipelineBindingHint
 Initializes a hint that binds push constants.
 
static auto pushConstants (UInt32 space, UInt32 binding) noexcept -> PipelineBindingHint
 Initializes a hint that binds push constants.
 
static auto staticSampler (DescriptorBindingPoint at, SharedPtr< ISampler > sampler) noexcept -> PipelineBindingHint
 Initializes a hint that binds a static sampler, if supported by the backend.
 
static auto staticSampler (UInt32 space, UInt32 binding, SharedPtr< ISampler > sampler) noexcept -> PipelineBindingHint
 Initializes a hint that binds a static sampler, if supported by the backend.
 
static auto resourceHeap (DescriptorBindingPoint at, UInt32 heapSize) noexcept -> PipelineBindingHint
 Initializes a hint that binds a proxy descriptor set to access the resource heap at the provided binding point.
 
static auto resourceHeap (UInt32 space, UInt32 binding, UInt32 heapSize) noexcept -> PipelineBindingHint
 Initializes a hint that binds a proxy descriptor set to access the resource heap at the provided binding point.
 
static auto samplerHeap (DescriptorBindingPoint at, UInt32 heapSize) noexcept -> PipelineBindingHint
 Initializes a hint that binds a proxy descriptor set to access the sampler heap at the provided binding point.
 
static auto samplerHeap (UInt32 space, UInt32 binding, UInt32 heapSize) noexcept -> PipelineBindingHint
 Initializes a hint that binds a proxy descriptor set to access the sampler heap at the provided binding point.
 
static auto shaderStage (DescriptorBindingPoint at, ShaderStage shaderStages) noexcept -> PipelineBindingHint
 Initializes a hint provides additional shader stages, that may be not covered by shader reflection.
 
static auto shaderStage (UInt32 space, UInt32 binding, ShaderStage shaderStages) noexcept -> PipelineBindingHint
 Initializes a hint provides additional shader stages, that may be not covered by shader reflection.
 

Public Attributes

DescriptorBindingPoint Binding { }
 The binding point the hint applies to.
 
hint_type Hint = std::monostate{ }
 Stores the underlying hint.
 

Detailed Description

A hint used during shader reflection to control the pipeline layout.

Hints are generally used to express the desired layout to backends that cannot infer them implicitly. They do not imply an enforcement of the layout otherwise. For example, hinting a push constants range when performing shader reflection in Vulkan, where push constants are supported by the reflection library, will not affect the ultimate decision on whether the layout will contain a push constants range. In this case, shader reflection will always emit a push constants range.

Backends do emit diagnostic log messages, if a hint is given that it will ignore. Hints for descriptors that are not bound will silently be ignored.

See also
IShaderProgram::reflectPipelineLayout

Member Typedef Documentation

◆ hint_type

Member Function Documentation

◆ pushConstants() [1/2]

static auto LiteFX::Rendering::PipelineBindingHint::pushConstants ( DescriptorBindingPoint at) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds push constants.

Parameters
atThe binding point the hint applies to.
Returns
The initialized pipeline binding hint.

◆ pushConstants() [2/2]

static auto LiteFX::Rendering::PipelineBindingHint::pushConstants ( UInt32 space,
UInt32 binding ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds push constants.

Parameters
spaceThe descriptor space of the binding point.
bindingThe register of the descriptor binding point.
Returns
The initialized pipeline binding hint.

◆ resourceHeap() [1/2]

static auto LiteFX::Rendering::PipelineBindingHint::resourceHeap ( DescriptorBindingPoint at,
UInt32 heapSize ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds a proxy descriptor set to access the resource heap at the provided binding point.

Parameters
atThe binding point the hint applies to.
heapSizeThe number of descriptors allocated for the heap when creating the descriptor set.
Returns
The initialized pipeline binding hint.
See also
GraphicsDeviceFeature::DynamicDescriptors

◆ resourceHeap() [2/2]

static auto LiteFX::Rendering::PipelineBindingHint::resourceHeap ( UInt32 space,
UInt32 binding,
UInt32 heapSize ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds a proxy descriptor set to access the resource heap at the provided binding point.

Parameters
spaceThe descriptor space of the binding point.
bindingThe register of the descriptor binding point.
heapSizeThe number of descriptors allocated for the heap when creating the descriptor set.
Returns
The initialized pipeline binding hint.
See also
GraphicsDeviceFeature::DynamicDescriptors

◆ runtimeArray() [1/2]

static auto LiteFX::Rendering::PipelineBindingHint::runtimeArray ( DescriptorBindingPoint at,
UInt32 maxDescriptors ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds an unbounded runtime array.

Parameters
atThe binding point the hint applies to.
maxDescriptorsThe maximum number of descriptors that can be bound to the runtime array at the binding point.
Returns
The initialized pipeline binding hint.

◆ runtimeArray() [2/2]

static auto LiteFX::Rendering::PipelineBindingHint::runtimeArray ( UInt32 space,
UInt32 binding,
UInt32 maxDescriptors ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds an unbounded runtime array.

Parameters
spaceThe descriptor space of the binding point.
bindingThe register of the descriptor binding point.
maxDescriptorsThe maximum number of descriptors that can be bound to the runtime array at the binding point.
Returns
The initialized pipeline binding hint.

◆ samplerHeap() [1/2]

static auto LiteFX::Rendering::PipelineBindingHint::samplerHeap ( DescriptorBindingPoint at,
UInt32 heapSize ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds a proxy descriptor set to access the sampler heap at the provided binding point.

Parameters
atThe binding point the hint applies to.
heapSizeThe number of descriptors allocated for the heap when creating the descriptor set.
Returns
The initialized pipeline binding hint.
See also
GraphicsDeviceFeature::DynamicDescriptors

◆ samplerHeap() [2/2]

static auto LiteFX::Rendering::PipelineBindingHint::samplerHeap ( UInt32 space,
UInt32 binding,
UInt32 heapSize ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds a proxy descriptor set to access the sampler heap at the provided binding point.

Parameters
spaceThe descriptor space of the binding point.
bindingThe register of the descriptor binding point.
heapSizeThe number of descriptors allocated for the heap when creating the descriptor set.
Returns
The initialized pipeline binding hint.
See also
GraphicsDeviceFeature::DynamicDescriptors

◆ shaderStage() [1/2]

static auto LiteFX::Rendering::PipelineBindingHint::shaderStage ( DescriptorBindingPoint at,
ShaderStage shaderStages ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint provides additional shader stages, that may be not covered by shader reflection.

Parameters
atThe binding point the hint applies to.
shaderStagesThe number of descriptors allocated for the heap when creating the descriptor set.
Returns
The initialized pipeline binding hint.
See also
GraphicsDeviceFeature::DynamicDescriptors

◆ shaderStage() [2/2]

static auto LiteFX::Rendering::PipelineBindingHint::shaderStage ( UInt32 space,
UInt32 binding,
ShaderStage shaderStages ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint provides additional shader stages, that may be not covered by shader reflection.

Parameters
spaceThe descriptor space of the binding point.
bindingThe register of the descriptor binding point.
shaderStagesThe number of descriptors allocated for the heap when creating the descriptor set.
Returns
The initialized pipeline binding hint.
See also
GraphicsDeviceFeature::DynamicDescriptors

◆ staticSampler() [1/2]

static auto LiteFX::Rendering::PipelineBindingHint::staticSampler ( DescriptorBindingPoint at,
SharedPtr< ISampler > sampler ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds a static sampler, if supported by the backend.

Parameters
atThe binding point the hint applies to.
samplerThe sampler state used to initialize the static sampler with.
Returns
The initialized pipeline binding hint.

◆ staticSampler() [2/2]

static auto LiteFX::Rendering::PipelineBindingHint::staticSampler ( UInt32 space,
UInt32 binding,
SharedPtr< ISampler > sampler ) -> PipelineBindingHint
inlinestaticnoexcept

Initializes a hint that binds a static sampler, if supported by the backend.

Parameters
spaceThe descriptor space of the binding point.
bindingThe register of the descriptor binding point.
samplerThe sampler state used to initialize the static sampler with.
Returns
The initialized pipeline binding hint.

Member Data Documentation

◆ Binding

DescriptorBindingPoint LiteFX::Rendering::PipelineBindingHint::Binding { }

The binding point the hint applies to.

◆ Hint

hint_type LiteFX::Rendering::PipelineBindingHint::Hint = std::monostate{ }

Stores the underlying hint.