Gorgon
Show / Hide Table of Contents

Class GorgonPipelineStateBuilder

A builder used to create pipeline render state objects.

Inheritance
object
GorgonPipelineStateBuilder
Implements
IGorgonGraphicsObject
IGorgonFluentBuilder<GorgonPipelineStateBuilder, GorgonPipelineState>
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonPipelineStateBuilder : IGorgonGraphicsObject, IGorgonFluentBuilder<GorgonPipelineStateBuilder, GorgonPipelineState>
Remarks

Use this builder to create a new GorgonPipelineState object to pass to a draw call. This object provides a fluent interface to help build up a pipeline state.

A pipeline state object is used to define the state of the pipeline prior to drawing anything. It can be used to assign shaders, and various other states that will affect how data is rasterized on the GPU.

The pipeline state object is immutable, and as such cannot be changed directly. To create a new pipeline state object, use this object to define the parameters for the pipeline state.

Pipeline states are assigned to a draw call via one of the draw call builders.

Constructors

| Edit this page View Source

GorgonPipelineStateBuilder(GorgonGraphics)

Initializes a new instance of the GorgonPipelineStateBuilder class.

Declaration
public GorgonPipelineStateBuilder(GorgonGraphics graphics)
Parameters
Type Name Description
GorgonGraphics graphics

The graphics object that will build the pipeline state.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder

Properties

| Edit this page View Source

Graphics

Property to return the graphics interface used to build the pipeline state.

Declaration
public GorgonGraphics Graphics { get; }
Property Value
Type Description
GorgonGraphics
See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder

Methods

| Edit this page View Source

BlendState(GorgonBlendState, int)

Function to assign a GorgonBlendState to the pipeline.

Declaration
public GorgonPipelineStateBuilder BlendState(GorgonBlendState state, int slot = 0)
Parameters
Type Name Description
GorgonBlendState state

The state to apply to the pipeline

int slot

[Optional] The slot to assign the states into.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent builder interface.

Exceptions
Type Condition
ArgumentNullException

Thrown when the slot is less than 0, or greater than/equal to 8.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

BlendStates(IReadOnlyList<GorgonBlendState>, int)

Function to assign a list of GorgonBlendState objects to the pipeline.

Declaration
public GorgonPipelineStateBuilder BlendStates(IReadOnlyList<GorgonBlendState> states, int startSlot = 0)
Parameters
Type Name Description
IReadOnlyList<GorgonBlendState> states

The states to apply to the pipeline

int startSlot

[Optional] The first slot to assign the states into.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent builder interface.

Exceptions
Type Condition
ArgumentNullException

Thrown when the startSlot is less than 0, or greater than/equal to 8.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

Build()

Function to build a pipeline state.

Declaration
public GorgonPipelineState Build()
Returns
Type Description
GorgonPipelineState

A new pipeline state.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

Clear()

Function to clear the current pipeline state.

Declaration
public GorgonPipelineStateBuilder Clear()
Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for the builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

DepthStencilState(GorgonDepthStencilState)

Function to add a depth/stencil state to this pipeline state.

Declaration
public GorgonPipelineStateBuilder DepthStencilState(GorgonDepthStencilState state)
Parameters
Type Name Description
GorgonDepthStencilState state

The depth/stencil state to apply.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

DepthStencilState(GorgonDepthStencilStateBuilder)

Function to add a depth/stencil state to this pipeline state.

Declaration
public GorgonPipelineStateBuilder DepthStencilState(GorgonDepthStencilStateBuilder state)
Parameters
Type Name Description
GorgonDepthStencilStateBuilder state

The depth/stencil state to apply.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

DisableAlphaCoverage()

Function to disable alpha coverage for blending.

Declaration
public GorgonPipelineStateBuilder DisableAlphaCoverage()
Returns
Type Description
GorgonPipelineStateBuilder

The fluent builder interface.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

DisableIndependentBlending()

Function to disable independent render target blending

Declaration
public GorgonPipelineStateBuilder DisableIndependentBlending()
Returns
Type Description
GorgonPipelineStateBuilder

The fluent builder interface.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

DomainShader(GorgonDomainShader)

Function to set the current domain shader on the pipeline.

Declaration
public GorgonPipelineStateBuilder DomainShader(GorgonDomainShader domainShader)
Parameters
Type Name Description
GorgonDomainShader domainShader

The domain shader to assign.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

EnableAlphaCoverage()

Function to enable alpha coverage for blending.

Declaration
public GorgonPipelineStateBuilder EnableAlphaCoverage()
Returns
Type Description
GorgonPipelineStateBuilder

The fluent builder interface.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

EnableIndependentBlending()

Function to enable independent render target blending.

Declaration
public GorgonPipelineStateBuilder EnableIndependentBlending()
Returns
Type Description
GorgonPipelineStateBuilder

The fluent builder interface.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

GeometryShader(GorgonGeometryShader)

Function to set the current geometry shader on the pipeline.

Declaration
public GorgonPipelineStateBuilder GeometryShader(GorgonGeometryShader geometryShader)
Parameters
Type Name Description
GorgonGeometryShader geometryShader

The geometry shader to assign.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

HullShader(GorgonHullShader)

Function to set the current hull shader on the pipeline.

Declaration
public GorgonPipelineStateBuilder HullShader(GorgonHullShader hullShader)
Parameters
Type Name Description
GorgonHullShader hullShader

The domain shader to assign.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

PixelShader(GorgonPixelShader)

Function to set the current pixel shader on the pipeline.

Declaration
public GorgonPipelineStateBuilder PixelShader(GorgonPixelShader pixelShader)
Parameters
Type Name Description
GorgonPixelShader pixelShader

The pixel shader to assign.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

PrimitiveType(PrimitiveType)

Function to set primitive topology for the draw call.

Declaration
public GorgonPipelineStateBuilder PrimitiveType(PrimitiveType primitiveType)
Parameters
Type Name Description
PrimitiveType primitiveType

The type of primitive to render.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent builder interface.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

RasterState(GorgonRasterState)

Function to add a rasterizer state to this pipeline state.

Declaration
public GorgonPipelineStateBuilder RasterState(GorgonRasterState state)
Parameters
Type Name Description
GorgonRasterState state

The rasterizer state to apply.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

RasterState(GorgonRasterStateBuilder)

Function to add a rasterizer state to this pipeline state.

Declaration
public GorgonPipelineStateBuilder RasterState(GorgonRasterStateBuilder state)
Parameters
Type Name Description
GorgonRasterStateBuilder state

The rasterizer state to apply.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

ResetTo(GorgonPipelineState)

Function to reset the pipeline state to the specified state passed in to the method.

Declaration
public GorgonPipelineStateBuilder ResetTo(GorgonPipelineState pipeState)
Parameters
Type Name Description
GorgonPipelineState pipeState

The pipeline state to copy.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for the builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
| Edit this page View Source

VertexShader(GorgonVertexShader)

Function to set the current vertex shader on the pipeline.

Declaration
public GorgonPipelineStateBuilder VertexShader(GorgonVertexShader vertexShader)
Parameters
Type Name Description
GorgonVertexShader vertexShader

The vertex shader to assign.

Returns
Type Description
GorgonPipelineStateBuilder

The fluent interface for this builder.

See Also
GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder

Implements

IGorgonGraphicsObject
IGorgonFluentBuilder<TB, TBo>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

GorgonPipelineState
GorgonPipelineStateBuilder
GorgonDrawCallBuilder
GorgonDrawIndexCallBuilder
GorgonStreamOutCallBuilder
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author