Gorgon
Show / Hide Table of Contents

Class GorgonDrawIndexCallBuilder

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

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

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

GorgonDrawIndexCallBuilder()

Initializes a new instance of the GorgonDrawIndexCallBuilder class.

Declaration
public GorgonDrawIndexCallBuilder()
See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawIndexCall

Methods

| Edit this page View Source

BaseVertexIndex(int)

Function to set the base vertex index.

Declaration
public GorgonDrawIndexCallBuilder BaseVertexIndex(int baseVertexIndex)
Parameters
Type Name Description
int baseVertexIndex

The base vertex index to set.

Returns
Type Description
GorgonDrawIndexCallBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawIndexCall
| Edit this page View Source

IndexBuffer(GorgonIndexBuffer, int, int?)

Function to assign an index buffer to the draw call.

Declaration
public GorgonDrawIndexCallBuilder IndexBuffer(GorgonIndexBuffer buffer, int indexStart = 0, int? indexCount = null)
Parameters
Type Name Description
GorgonIndexBuffer buffer

The buffer to assign.

int indexStart

[Optional] The first index in the index buffer to render.

int? indexCount

[Optional] The number of indices to render.

Returns
Type Description
GorgonDrawIndexCallBuilder

The fluent builder interface.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the indexStart parameter is less than 0.

-or-

Thrown when the indexCount parameter is less than 1.

See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawIndexCall
| Edit this page View Source

IndexRange(int, int)

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

Declaration
public GorgonDrawIndexCallBuilder IndexRange(int indexStart, int indexCount)
Parameters
Type Name Description
int indexStart

The first index in the index buffer to render.

int indexCount

The number of indices to render.

Returns
Type Description
GorgonDrawIndexCallBuilder

The fluent builder interface.

Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the indexStart parameter is less than 0.

-or-

Thrown when the indexCount parameter is less than 1.

See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawIndexCall
| Edit this page View Source

OnClear()

Function to clear the draw call.

Declaration
protected override GorgonDrawIndexCallBuilder OnClear()
Returns
Type Description
GorgonDrawIndexCallBuilder

The fluent builder interface.

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

OnCreate(IGorgonAllocator<GorgonDrawIndexCall>)

Function to create a new draw call.

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

The allocator to use when creating draw call objects.

Returns
Type Description
GorgonDrawIndexCall

A new draw call.

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

OnResetTo(GorgonDrawIndexCall)

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

Declaration
protected override GorgonDrawIndexCallBuilder OnResetTo(GorgonDrawIndexCall drawCall)
Parameters
Type Name Description
GorgonDrawIndexCall drawCall

The draw call to copy from.

Returns
Type Description
GorgonDrawIndexCallBuilder

The fluent builder interface.

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

OnUpdate(GorgonDrawIndexCall)

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

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

The object representing the finalized copy.

Overrides
GorgonDrawCallBuilderCommon<GorgonDrawIndexCallBuilder, GorgonDrawIndexCall>.OnUpdate(GorgonDrawIndexCall)
See Also
GorgonGraphics
GorgonPipelineState
GorgonDrawIndexCall

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
GorgonDrawIndexCall
  • 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