Class GorgonPipelineStateBuilder
A builder used to create pipeline render state objects.
Implements
Inherited Members
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 SourceGorgonPipelineStateBuilder(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
Properties
| Edit this page View SourceGraphics
Property to return the graphics interface used to build the pipeline state.
Declaration
public GorgonGraphics Graphics { get; }
Property Value
Type | Description |
---|---|
GorgonGraphics |
See Also
Methods
| Edit this page View SourceBlendState(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 |
See Also
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 |
See Also
Build()
Function to build a pipeline state.
Declaration
public GorgonPipelineState Build()
Returns
Type | Description |
---|---|
GorgonPipelineState | A new pipeline state. |
See Also
Clear()
Function to clear the current pipeline state.
Declaration
public GorgonPipelineStateBuilder Clear()
Returns
Type | Description |
---|---|
GorgonPipelineStateBuilder | The fluent interface for the builder. |
See Also
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
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
DisableAlphaCoverage()
Function to disable alpha coverage for blending.
Declaration
public GorgonPipelineStateBuilder DisableAlphaCoverage()
Returns
Type | Description |
---|---|
GorgonPipelineStateBuilder | The fluent builder interface. |
See Also
DisableIndependentBlending()
Function to disable independent render target blending
Declaration
public GorgonPipelineStateBuilder DisableIndependentBlending()
Returns
Type | Description |
---|---|
GorgonPipelineStateBuilder | The fluent builder interface. |
See Also
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
EnableAlphaCoverage()
Function to enable alpha coverage for blending.
Declaration
public GorgonPipelineStateBuilder EnableAlphaCoverage()
Returns
Type | Description |
---|---|
GorgonPipelineStateBuilder | The fluent builder interface. |
See Also
EnableIndependentBlending()
Function to enable independent render target blending.
Declaration
public GorgonPipelineStateBuilder EnableIndependentBlending()
Returns
Type | Description |
---|---|
GorgonPipelineStateBuilder | The fluent builder interface. |
See Also
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
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
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
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
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
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
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
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. |