Gorgon
Show / Hide Table of Contents

Class GorgonDrawCallBuilder

A builder class used to create basic draw calls using fluent calls.

Inheritance
object
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>
GorgonDrawCallBuilder
Implements
IGorgonFluentBuilderAllocator<GorgonDrawCallBuilder, GorgonDrawCall, IGorgonAllocator<GorgonDrawCall>>
IGorgonFluentBuilder<GorgonDrawCallBuilder, GorgonDrawCall>
Inherited Members
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.DrawCall
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnCreate(IGorgonAllocator<GorgonDrawCall>)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnUpdate(GorgonDrawCall)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnResetTo(GorgonDrawCall)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnClear()
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.SamplerStates(ShaderType, IReadOnlyList<GorgonSamplerState>, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.SamplerState(ShaderType, GorgonSamplerStateBuilder, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.SamplerState(ShaderType, GorgonSamplerState, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.PipelineState(GorgonPipelineState)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.PipelineState(GorgonPipelineStateBuilder)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.StreamOutBuffer(in GorgonStreamOutBinding, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.StreamOutBuffers(IReadOnlyList<GorgonStreamOutBinding>)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.VertexBuffer(GorgonInputLayout, in GorgonVertexBufferBinding, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.VertexBuffers(GorgonInputLayout, IReadOnlyList<GorgonVertexBufferBinding>)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.ConstantBuffer(ShaderType, GorgonConstantBufferView, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.ConstantBuffers(ShaderType, IReadOnlyList<GorgonConstantBufferView>, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.ShaderResource(ShaderType, GorgonShaderResourceView, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.ShaderResources(ShaderType, IReadOnlyList<GorgonShaderResourceView>, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.ReadWriteView(in GorgonReadWriteViewBinding, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.ReadWriteViews(IReadOnlyList<GorgonReadWriteViewBinding>, int)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.ResetTo(GorgonDrawCall)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.Clear()
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.Build(IGorgonAllocator<GorgonDrawCall>)
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.Build()
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 GorgonDrawCallBuilder : GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>, IGorgonFluentBuilderAllocator<GorgonDrawCallBuilder, GorgonDrawCall, IGorgonAllocator<GorgonDrawCall>>, IGorgonFluentBuilder<GorgonDrawCallBuilder, GorgonDrawCall>
Remarks

The draw call builder object allow applications to build the immutable draw call objects needed to send data and state information to the GPU.

A draw call is an immutable object that contains all of the state required to render mesh information. For each mesh an application needs to render, an single draw call should be issued via the Submit(GorgonDrawCall, in GorgonColor?, int, int) methods.

State management is handled internally by Gorgon so that duplicate states are not set and thus, performance is not impacted by redundant states.

Because a draw call is immutable, it is not possible to modify a draw call after it's been created. However, a copy of a draw call can be created using the ResetTo(TDc) method on the this object. Or, the builder can be modified after the creation of your draw call that needs to be updated and a new call may be built then.

This builder type uses a fluent interface to assemble the draw call, its resources and its GorgonPipelineState.

Constructors

| Edit this page View Source

GorgonDrawCallBuilder()

Initializes a new instance of the GorgonDrawCallBuilder class.

Declaration
public GorgonDrawCallBuilder()
See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawCall

Methods

| Edit this page View Source

OnClear()

Function to clear the builder to a default state.

Declaration
protected override GorgonDrawCallBuilder OnClear()
Returns
Type Description
GorgonDrawCallBuilder

The fluent builder interface.

Overrides
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnClear()
See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawCall
| Edit this page View Source

OnCreate(IGorgonAllocator<GorgonDrawCall>)

Function to create a new draw call.

Declaration
protected override GorgonDrawCall OnCreate(IGorgonAllocator<GorgonDrawCall> allocator)
Parameters
Type Name Description
IGorgonAllocator<GorgonDrawCall> allocator

The allocator to use when creating draw call objects.

Returns
Type Description
GorgonDrawCall

A new draw call.

Overrides
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnCreate(IGorgonAllocator<GorgonDrawCall>)
See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawCall
| Edit this page View Source

OnResetTo(GorgonDrawCall)

Function to reset the properties of the draw call to the draw call passed in.

Declaration
protected override GorgonDrawCallBuilder OnResetTo(GorgonDrawCall drawCall)
Parameters
Type Name Description
GorgonDrawCall drawCall

The draw call to copy from.

Returns
Type Description
GorgonDrawCallBuilder

The fluent builder interface.

Overrides
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnResetTo(GorgonDrawCall)
See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawCall
| Edit this page View Source

OnUpdate(GorgonDrawCall)

Function to update the properties of the draw call from the working copy to the final copy.

Declaration
protected override void OnUpdate(GorgonDrawCall finalCopy)
Parameters
Type Name Description
GorgonDrawCall finalCopy

The object representing the finalized copy.

Overrides
GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>.OnUpdate(GorgonDrawCall)
See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawCall
| Edit this page View Source

VertexRange(int, int)

Function to set the first vertex index, and the number of vertices to render in the draw call.

Declaration
public GorgonDrawCallBuilder VertexRange(int index, int count)
Parameters
Type Name Description
int index

The index of the first vertex in the vertex buffer to render.

int count

The number of vertices to render.

Returns
Type Description
GorgonDrawCallBuilder

The fluent builder interface.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the index parameter is less than 0.

-or-

Thrown when the count parameter is less than 1.

See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawCall

Implements

IGorgonFluentBuilderAllocator<TB, TBo, TBa>
IGorgonFluentBuilder<TB, TBo>

Extension Methods

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

See Also

GorgonGraphics
GorgonPipelineState
GorgonDrawCall
  • 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