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

Graphics pipeline state descriptor structure. More...

#include <PipelineStateFlags.h>

Public Attributes

const char * debugName = nullptr
 Optional name for debugging purposes. By default null.
const PipelineLayout * pipelineLayout = nullptr
 Specifies an optional pipeline layout for the graphics pipeline. By default null.
const RenderPass * renderPass = nullptr
 Specifies an optional render pass. By default null.
DynamicVector< VertexAttribute > inputVertexAttribs
 Vertex input attributes.
DynamicVector< VertexAttribute > outputVertexAttribs
 Vertex (or geometry or tessellation-evaluation) shader stream-output attributes.
Shader * vertexShader = nullptr
 Specifies the vertex shader.
Shader * tessControlShader = nullptr
 Specifies the tessellation-control shader (also referred to as "Hull Shader").
Shader * tessEvaluationShader = nullptr
 Specifies the tessellation-evaluation shader (also referred to as "Domain Shader").
Shader * geometryShader = nullptr
 Specifies an optional geometry shader.
Shader * fragmentShader = nullptr
 Specifies an optional fragment shader (also referred to as "Pixel Shader").
Format indexFormat = Format::Undefined
 Specifies the index buffer format. This can either be Format::Undefined, Format::R16UInt, or Format::R32UInt. By default Format::Undefined.
PrimitiveTopology primitiveTopology = PrimitiveTopology::TriangleList
 Specifies the primitive topology and ordering of the primitive data. By default PrimitiveTopology::TriangleList.
DynamicVector< Viewport > viewports
 Specifies an optional list of static viewports. If empty, the viewports must be set dynamically with the command buffer.
DynamicVector< Scissor > scissors
 Specifies an optional list of static scissor rectangles. If empty, the scissors must be set dynamically with the command buffer.
DepthDescriptor depth
 Specifies the depth state for the depth-stencil stage.
StencilDescriptor stencil
 Specifies the stencil state for the depth-stencil stage.
RasterizerDescriptor rasterizer
 Specifies the state for the rasterizer stage.
BlendDescriptor blend
 Specifies the state descriptor for the blend stage.
TessellationDescriptor tessellation
 Specifies the tessellation pipeline state.

Detailed Description

Graphics pipeline state descriptor structure.

Remarks
This structure describes the entire graphics pipeline: shader stages, depth-/ stencil-/ rasterizer-/ blend states etc.
See also
RenderSystem::CreatePipelineState(const GraphicsPipelineDescriptor&)

Member Data Documentation

◆ blend

BlendDescriptor LLGL::GraphicsPipelineDescriptor::blend

Specifies the state descriptor for the blend stage.

◆ debugName

const char* LLGL::GraphicsPipelineDescriptor::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

◆ depth

DepthDescriptor LLGL::GraphicsPipelineDescriptor::depth

Specifies the depth state for the depth-stencil stage.

◆ fragmentShader

Shader* LLGL::GraphicsPipelineDescriptor::fragmentShader = nullptr

Specifies an optional fragment shader (also referred to as "Pixel Shader").

Remarks
If no fragment shader is specified, generated fragments are discarded by the output merger and only the stream-output functionality as well as depth writes are used by either the vertex or geometry shader. If a depth buffer is attached to the current render target, omitting the fragment shader can be utilized to render a standard shadow map.

◆ geometryShader

Shader* LLGL::GraphicsPipelineDescriptor::geometryShader = nullptr

Specifies an optional geometry shader.

Remarks
This shader may also have a stream output.

◆ indexFormat

Format LLGL::GraphicsPipelineDescriptor::indexFormat = Format::Undefined

Specifies the index buffer format. This can either be Format::Undefined, Format::R16UInt, or Format::R32UInt. By default Format::Undefined.

Remarks
For patches (PrimitiveTopology::Patches1 - PrimitiveTopology::Patches32), line strips (PrimitiveTopology::LineStrip, PrimitiveTopology::LineStripAdjacency), and triangle strips (PrimitiveTopology::TriangleStrip, PrimitiveTopology::TriangleStripAdjacency) some backends might generate two internal PSOs if the index format is undefined. For instance, the D3D12 backend needs to specify the strip index cut value for either 16 or 32 bit indices at PSO creation time. For performance reasons, it is therefore recommended to set this value to either Format::R16UInt or Format::R32UInt when the primitive topology is one of the aforementioned types.
See also
CommandBuffer::DrawIndexed
CommandBuffer::DrawIndexedInstanced

◆ inputVertexAttribs

DynamicVector<VertexAttribute> LLGL::GraphicsPipelineDescriptor::inputVertexAttribs

Vertex input attributes.

Remarks
In previous versions of LLGL, vertex attributes were tied to both the vertex shader and vertex buffer. The new API makes them part of the graphics PSO only. This reduces the declaration to a single point of truth and also allows a vertex buffer to be used with different vertex formats.

◆ outputVertexAttribs

DynamicVector<VertexAttribute> LLGL::GraphicsPipelineDescriptor::outputVertexAttribs

Vertex (or geometry or tessellation-evaluation) shader stream-output attributes.

Remarks
The binding slot of each output vertex attribute must be less than LLGL_MAX_NUM_SO_BUFFERS.
Stream-output attributes can only have 32-bit floating-point formats, i.e. only the following formats are supported:
See also
RenderingFeatures::hasStreamOutputs
CommandBuffer::BeginStreamOutput

◆ pipelineLayout

const PipelineLayout* LLGL::GraphicsPipelineDescriptor::pipelineLayout = nullptr

Specifies an optional pipeline layout for the graphics pipeline. By default null.

Remarks
This layout determines at which slots buffer resources will be bound. If this is null, a default layout will be used that is only compatible with graphics pipelines that have no binding points, i.e. no input/output buffers or textures.
See also
RenderSystem::CreatePipelineLayout

◆ primitiveTopology

PrimitiveTopology LLGL::GraphicsPipelineDescriptor::primitiveTopology = PrimitiveTopology::TriangleList

Specifies the primitive topology and ordering of the primitive data. By default PrimitiveTopology::TriangleList.

See also
PrimitiveTopology

◆ rasterizer

RasterizerDescriptor LLGL::GraphicsPipelineDescriptor::rasterizer

Specifies the state for the rasterizer stage.

◆ renderPass

const RenderPass* LLGL::GraphicsPipelineDescriptor::renderPass = nullptr

Specifies an optional render pass. By default null.

Remarks
If this is null, the render pass of the SwapChain that was first created is used. This render pass must be compatible with the one passed to the CommandBuffer::BeginRenderPass function in which the graphics pipeline will be used.
See also
CommandBuffer::BeginRenderPass
RenderSystem::CreateRenderPass

◆ scissors

DynamicVector<Scissor> LLGL::GraphicsPipelineDescriptor::scissors

Specifies an optional list of static scissor rectangles. If empty, the scissors must be set dynamically with the command buffer.

Remarks
This list must have the same number of entries as viewports, unless one of the lists is empty.
See also
CommandBuffer::SetScissor
CommandBuffer::SetScissors

◆ stencil

StencilDescriptor LLGL::GraphicsPipelineDescriptor::stencil

Specifies the stencil state for the depth-stencil stage.

◆ tessControlShader

Shader* LLGL::GraphicsPipelineDescriptor::tessControlShader = nullptr

Specifies the tessellation-control shader (also referred to as "Hull Shader").

Remarks
If this is used, the counter part must also be specified, i.e. tessEvaluationShader.
See also
tessEvaluationShader

◆ tessellation

TessellationDescriptor LLGL::GraphicsPipelineDescriptor::tessellation

Specifies the tessellation pipeline state.

Remarks
This is only used to configure a few tessellation states on the CPU side for the Metal backend. All other backends ignore this member silently.
Note
Only supported with: Metal.

◆ tessEvaluationShader

Shader* LLGL::GraphicsPipelineDescriptor::tessEvaluationShader = nullptr

Specifies the tessellation-evaluation shader (also referred to as "Domain Shader").

Remarks
If this is used, the counter part must also be specified, i.e. tessControlShader.
See also
tessControlShader

◆ vertexShader

Shader* LLGL::GraphicsPipelineDescriptor::vertexShader = nullptr

Specifies the vertex shader.

Remarks
Each graphics pipeline must have at least a vertex shader. Therefore, this must never be null when a graphics PSO is created. With OpenGL, this shader may also have a stream output.

◆ viewports

DynamicVector<Viewport> LLGL::GraphicsPipelineDescriptor::viewports

Specifies an optional list of static viewports. If empty, the viewports must be set dynamically with the command buffer.

Remarks
This list must have the same number of entries as scissors, unless one of the lists is empty.
See also
CommandBuffer::SetViewport
CommandBuffer::SetViewports

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