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

Pipeline layout descriptor structure. More...

#include <PipelineLayoutFlags.h>

Public Attributes

const char * debugName = nullptr
 Optional name for debugging purposes. By default null.
std::vector< BindingDescriptor > heapBindings
 List of layout resource heap bindings.
std::vector< BindingDescriptor > bindings
 List of individual layout resource bindings.
std::vector< StaticSamplerDescriptor > staticSamplers
 List of static sampler states with their binding points.
std::vector< UniformDescriptor > uniforms
 List of shader uniforms that can be written dynamically.
std::vector< CombinedTextureSamplerDescriptor > combinedTextureSamplers
 List of combined texture-samplers.
long barrierFlags = 0
 Specifies optional resource barrier flags. This can be a bitwise-OR combination of BarrierFlags entries. By default 0.

Detailed Description

Pipeline layout descriptor structure.

Remarks
Contains all layout bindings that will be used by graphics and compute pipelines.
Note
For Vulkan, LLGL should be built with LLGL_VK_ENABLE_SPIRV_REFLECT when PSO layouts contain a mix of heap- and dynamic bindings, i.e. heapBindings and bindings respectively. Otherwise, LLGL cannot perform code reflection to create shader permutations to match binding points with various shader combinations.
See also
RenderSystem::CreatePipelineLayout

Member Data Documentation

◆ barrierFlags

long LLGL::PipelineLayoutDescriptor::barrierFlags = 0

Specifies optional resource barrier flags. This can be a bitwise-OR combination of BarrierFlags entries. By default 0.

Remarks
If the barrier flags are non-zero, they will be applied to all affected resources before each draw and compute command. This should be used when a resource is bound to the pipeline that was previously written to. A more fine-grained alternative is to explicitly insert barriers via the CommandBuffer::ResourceBarrier command.
See also
BarrierFlags
CommandBuffer::ResourceBarrier

◆ bindings

std::vector<BindingDescriptor> LLGL::PipelineLayoutDescriptor::bindings

List of individual layout resource bindings.

Remarks
These bindings refer to individual resource descriptors that are bound separately from a ResourceHeap.
Individual bindings are limited to binding the entire resource as opposed to heap bindigs that can also bind a subresource view.
See also
CommandBuffer::SetResource

◆ combinedTextureSamplers

std::vector<CombinedTextureSamplerDescriptor> LLGL::PipelineLayoutDescriptor::combinedTextureSamplers

List of combined texture-samplers.

Remarks
This can be used for backends that support combined texture-samplers when a sampler binding is used for more than one texture binding or if a sampler binding is used with a texture at a different binding slot. For backends that only support combined texture-samplers in shaders, such as OpenGL, this is required unless each texture binding in the pipeline layout has its own sampler binding at the same binding slot.
Note
Only supported with: OpenGL (Vulkan will be supported next).

◆ debugName

const char* LLGL::PipelineLayoutDescriptor::debugName = nullptr

Optional name for debugging purposes. By default null.

Remarks
The final name of the native hardware resource is implementation defined.
See also
RenderSystemChild::SetDebugName

◆ heapBindings

std::vector<BindingDescriptor> LLGL::PipelineLayoutDescriptor::heapBindings

List of layout resource heap bindings.

Remarks
These bindings refer to the resource descriptors that are all bound at once with a single ResourceHeap.
Only heap bindings can have subresource views as opposed to individual bindings that can only bind the entire resource.
In Direct3D 12 they are called "descriptor tables" and in Vulkan they are called "descriptor sets".
See also
CommandBuffer::SetResourceHeap
ResourceViewDescriptor
ResourceHeap::GetNumDescriptorSets

◆ staticSamplers

std::vector<StaticSamplerDescriptor> LLGL::PipelineLayoutDescriptor::staticSamplers

List of static sampler states with their binding points.

Remarks
These sampler states are immutable and are automatically bound with each pipeline state.

◆ uniforms

std::vector<UniformDescriptor> LLGL::PipelineLayoutDescriptor::uniforms

List of shader uniforms that can be written dynamically.

Remarks
In Vulkan they are called "push constants", in OpenGL they are called "uniforms", and in Direct3D they are called "shader constants".
Uniforms are not described by their binding slot, but solely by their name and type. They represent a small range within one or more constant buffers or push constant ranges and therefore don't have individual binding slots. Their offsets within these buffers are determined by LLGL when a PipelineState object (PSO) is created with a PipelineLayout that contains uniform descriptors. This process is highly dependent on the backend, the shaders used within the PSO, and other factors. It is advised to keep the number of uniforms small as there is only a very limited amount of space for uniforms:
  • Vulkan only guarantees a minimum of 128 bytes for the push constant ranges which is shared across all shader stages within a single PSO. That's just enough for two UniformType::Float4x4 matrices.
  • Metal has a limit of 4KB of on-demand block data in its command encoders which is utilized for uniforms in this backend.
  • Direct3D 12 has a fixed limit of 64 DWORDS (= 256 bytes) per root signature, which are claimed by all root parameters, including root constants (aka. uniforms). Only static samplers are not counted towards root parameters.
See also
CommandBuffer::SetUniforms

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