Class GorgonStreamOutCallBuilder
A builder used to create stream out draw call objects.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public sealed class GorgonStreamOutCallBuilder : IGorgonFluentBuilderAllocator<GorgonStreamOutCallBuilder, GorgonStreamOutCall, IGorgonAllocator<GorgonStreamOutCall>>, IGorgonFluentBuilder<GorgonStreamOutCallBuilder, GorgonStreamOutCall>
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 SubmitStreamOut(GorgonStreamOutCall, 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 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 draw call type sends a series of state changes and resource bindings to the GPU. However, unlike the various GorgonDrawCallCommon objects, this object uses pre-processed data from the vertex and stream out stages. This means that the GorgonVertexBuffer attached to the a previous draw call must have been assigned to the StreamOutBufferBindings and had data deposited into it from the stream out stage. After that, it should be removed from the StreamOutBufferBindings and assigned to the SharpDX.Direct3D11.VertexBufferBinding .
Constructors
| Edit this page View SourceGorgonStreamOutCallBuilder()
Initializes a new instance of the GorgonDrawCallBuilder class.
Declaration
public GorgonStreamOutCallBuilder()
See Also
Methods
| Edit this page View SourceBuild()
Function to return the draw call.
Declaration
public GorgonStreamOutCall Build()
Returns
Type | Description |
---|---|
GorgonStreamOutCall | The draw call created or updated by this builder. |
Exceptions
Type | Condition |
---|---|
GorgonException | Thrown if a GorgonVertexShader is not assigned to the VertexShader property with the PipelineState(GorgonStreamOutPipelineState) command. |
See Also
| Edit this page View SourceBuild(IGorgonAllocator<GorgonStreamOutCall>)
Function to return the draw call.
Declaration
public GorgonStreamOutCall Build(IGorgonAllocator<GorgonStreamOutCall> allocator)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAllocator<GorgonStreamOutCall> | allocator | The allocator used to create an instance of the object |
Returns
Type | Description |
---|---|
GorgonStreamOutCall | The draw call created or updated by this builder. |
Remarks
Using an allocator
can provide different strategies when building draw calls. If omitted, the draw call will be created using the standard new keyword.
A custom allocator can be beneficial because it allows us to use a pool for allocating the objects, and thus allows for recycling of objects. This keeps the garbage collector happy by keeping objects around for as long as we need them, instead of creating objects that can potentially end up in the large object heap or in Gen 2.
A stream out call requires that at least a vertex shader be bound. If none is present, then the method will throw an exception.
Exceptions
Type | Condition |
---|---|
GorgonException | Thrown if a GorgonVertexShader is not assigned to the VertexShader property with the PipelineState(GorgonStreamOutPipelineState) command. |
See Also
| Edit this page View SourceClear()
Function to clear the builder to a default state.
Declaration
public GorgonStreamOutCallBuilder Clear()
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceConstantBuffer(GorgonConstantBufferView, int)
Function to set a constant buffer for a pixel shader.
Declaration
public GorgonStreamOutCallBuilder ConstantBuffer(GorgonConstantBufferView constantBuffer, int slot = 0)
Parameters
Type | Name | Description |
---|---|---|
GorgonConstantBufferView | constantBuffer | The constant buffer to assign. |
int | slot | The slot for the constant buffer. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceConstantBuffers(IReadOnlyList<GorgonConstantBufferView>, int)
Function to set the constant buffers for a pixel shader.
Declaration
public GorgonStreamOutCallBuilder ConstantBuffers(IReadOnlyList<GorgonConstantBufferView> constantBuffers, int startSlot = 0)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<GorgonConstantBufferView> | constantBuffers | The constant buffers to copy. |
int | startSlot | [Optional] The starting slot to use when copying the list. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourcePipelineState(GorgonStreamOutPipelineState)
Function to set the pipeline state for this draw call.
Declaration
public GorgonStreamOutCallBuilder PipelineState(GorgonStreamOutPipelineState pipelineState)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutPipelineState | pipelineState | The pipeline state to assign. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourcePipelineState(GorgonStreamOutPipelineStateBuilder)
Function to set the pipeline state for this draw call.
Declaration
public GorgonStreamOutCallBuilder PipelineState(GorgonStreamOutPipelineStateBuilder pipelineState)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutPipelineStateBuilder | pipelineState | The pipeline state to assign. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceReadWriteView(in GorgonReadWriteViewBinding, int)
Function to assign a single read/write (unordered access) view to the draw call.
Declaration
public GorgonStreamOutCallBuilder ReadWriteView(in GorgonReadWriteViewBinding resourceView, int slot = 0)
Parameters
Type | Name | Description |
---|---|---|
GorgonReadWriteViewBinding | resourceView | The shader resource view to assign. |
int | slot | [Optional] The slot used to asign the view. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceReadWriteViews(IReadOnlyList<GorgonReadWriteViewBinding>, int)
Function to assign the list of read/write (unordered access) views to the draw call.
Declaration
public GorgonStreamOutCallBuilder ReadWriteViews(IReadOnlyList<GorgonReadWriteViewBinding> resourceViews, int startSlot = 0)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<GorgonReadWriteViewBinding> | resourceViews | The shader resource views to copy. |
int | startSlot | [Optional] The starting slot to use when copying the list. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface . |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceResetTo(GorgonStreamOutCall)
Function to reset the builder to the specified draw call state.
Declaration
public GorgonStreamOutCallBuilder ResetTo(GorgonStreamOutCall drawCall = null)
Parameters
Type | Name | Description |
---|---|---|
GorgonStreamOutCall | drawCall | [Optional] The specified draw call state to copy. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceSamplerState(GorgonSamplerState, int)
Function to assign a sampler to a pixel shader on the pipeline.
Declaration
public GorgonStreamOutCallBuilder SamplerState(GorgonSamplerState sampler, int index = 0)
Parameters
Type | Name | Description |
---|---|---|
GorgonSamplerState | sampler | The sampler to assign. |
int | index | [Optional] The index of the sampler. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent interface for this builder. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if the |
See Also
| Edit this page View SourceSamplerState(GorgonSamplerStateBuilder, int)
Function to assign a sampler to a pixel shader on the pipeline.
Declaration
public GorgonStreamOutCallBuilder SamplerState(GorgonSamplerStateBuilder sampler, int index = 0)
Parameters
Type | Name | Description |
---|---|---|
GorgonSamplerStateBuilder | sampler | The sampler to assign. |
int | index | [Optional] The index of the sampler. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent interface for this builder. |
See Also
| Edit this page View SourceSamplerStates(IReadOnlyList<GorgonSamplerState>, int)
Function to assign a list of samplers to a shader on the pipeline.
Declaration
public GorgonStreamOutCallBuilder SamplerStates(IReadOnlyList<GorgonSamplerState> samplers, int index = 0)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<GorgonSamplerState> | samplers | The samplers to assign. |
int | index | [Optional] The index to use when copying the list. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent interface for this builder. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if the |
See Also
| Edit this page View SourceShaderResource(GorgonShaderResourceView, int)
Function to assign a single pixel shader resource view to the draw call.
Declaration
public GorgonStreamOutCallBuilder ShaderResource(GorgonShaderResourceView resourceView, int slot = 0)
Parameters
Type | Name | Description |
---|---|---|
GorgonShaderResourceView | resourceView | The shader resource view to assign. |
int | slot | [Optional] The slot used to asign the view. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceShaderResources(IReadOnlyList<GorgonShaderResourceView>, int)
Function to assign the list of pixel shader resource views to the draw call.
Declaration
public GorgonStreamOutCallBuilder ShaderResources(IReadOnlyList<GorgonShaderResourceView> resourceViews, int startSlot = 0)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<GorgonShaderResourceView> | resourceViews | The shader resource views to copy. |
int | startSlot | [Optional] The starting slot to use when copying the list. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface . |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceVertexBuffer(GorgonInputLayout, in GorgonVertexBufferBinding)
Function to set a vertex buffer binding for the draw call in slot 0.
Declaration
public GorgonStreamOutCallBuilder VertexBuffer(GorgonInputLayout layout, in GorgonVertexBufferBinding binding)
Parameters
Type | Name | Description |
---|---|---|
GorgonInputLayout | layout | The input layout to use. |
GorgonVertexBufferBinding | binding | The vertex buffer binding to set. |
Returns
Type | Description |
---|---|
GorgonStreamOutCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |