Class GorgonDispatchCallBuilder
A builder used to create GorgonDispatchCall objects.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonDispatchCallBuilder : IGorgonFluentBuilderAllocator<GorgonDispatchCallBuilder, GorgonDispatchCall, IGorgonAllocator<GorgonDispatchCall>>, IGorgonFluentBuilder<GorgonDispatchCallBuilder, GorgonDispatchCall>
Constructors
| Edit this page View SourceGorgonDispatchCallBuilder()
Initializes a new instance of the GorgonDispatchCallBuilder class.
Declaration
public GorgonDispatchCallBuilder()
See Also
Methods
| Edit this page View SourceBuild()
Function to return the dispatch call.
Declaration
public GorgonDispatchCall Build()
Returns
Type | Description |
---|---|
GorgonDispatchCall | The dispatch call created or updated by this builder. |
Exceptions
Type | Condition |
---|---|
GorgonException | Thrown if a GorgonComputeShader is not assigned to the GorgonComputeShader property with the ComputeShader(GorgonComputeShader) command. |
See Also
| Edit this page View SourceBuild(IGorgonAllocator<GorgonDispatchCall>)
Function to return the dispatch call.
Declaration
public GorgonDispatchCall Build(IGorgonAllocator<GorgonDispatchCall> allocator)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAllocator<GorgonDispatchCall> | allocator | The allocator used to create an instance of the object |
Returns
Type | Description |
---|---|
GorgonDispatchCall | The dispatch call created or updated by this builder. |
Remarks
Using an allocator
can provide different strategies when building dispatch calls. If omitted, the dispatch 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 dispatch 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 GorgonComputeShader is not assigned to the GorgonComputeShader property with the ComputeShader(GorgonComputeShader) command. |
See Also
| Edit this page View SourceClear()
Function to clear the builder to a default state.
Declaration
public GorgonDispatchCallBuilder Clear()
Returns
Type | Description |
---|---|
GorgonDispatchCallBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceComputeShader(GorgonComputeShader)
Function to assign a compute shader to the call.
Declaration
public GorgonDispatchCallBuilder ComputeShader(GorgonComputeShader shader)
Parameters
Type | Name | Description |
---|---|---|
GorgonComputeShader | shader | The shader to assign. |
Returns
Type | Description |
---|---|
GorgonDispatchCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceConstantBuffer(GorgonConstantBufferView, int)
Function to set a constant buffer for a compute shader stage.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | 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 compute shader stage.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceReadWriteView(in GorgonReadWriteViewBinding, int)
Function to assign a single read/write (unordered access) view to the dispatch call.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | 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 dispatch call.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | The fluent builder interface . |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
See Also
| Edit this page View SourceResetTo(GorgonDispatchCall)
Function to reset the builder to the specified dispatch call state.
Declaration
public GorgonDispatchCallBuilder ResetTo(GorgonDispatchCall dispatchCall = null)
Parameters
Type | Name | Description |
---|---|---|
GorgonDispatchCall | dispatchCall | [Optional] The specified dispatch call state to copy. |
Returns
Type | Description |
---|---|
GorgonDispatchCallBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceSamplerState(GorgonSamplerState, int)
Function to assign a sampler to a shader on the pipeline.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | 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 compute shader on the pipeline.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | 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 compute shader on the pipeline.
Declaration
public GorgonDispatchCallBuilder SamplerStates(IReadOnlyList<GorgonSamplerState> samplers, int index = 0)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<GorgonSamplerState> | samplers | The samplers to assign. |
int | index | [Optional] The starting index to use when copying the list. |
Returns
Type | Description |
---|---|
GorgonDispatchCallBuilder | 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 shader resource view to the dispatch call.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | 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 shader resource views to the dispatch call.
Declaration
public GorgonDispatchCallBuilder 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 |
---|---|
GorgonDispatchCallBuilder | The fluent builder interface . |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |