Class ComputeEffectShader
- Namespace
- Stride.Rendering.ComputeEffect
- Assembly
- Stride.Rendering.dll
A compute effect based directly on a single compute shader.
public class ComputeEffectShader : DrawEffect, IComponent, IReferencable, ICollectorHolder, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
- Inheritance
-
objectComputeEffectShader
- Implements
- Inherited Members
- Extension Methods
Constructors
ComputeEffectShader(RenderContext)
public ComputeEffectShader(RenderContext context)
Parameters
contextRenderContext
Properties
EffectInstance
The current effect instance.
public DynamicEffectInstance EffectInstance { get; }
Property Value
IndirectArguments
Gets or sets a Buffer holding the thread group counts to dispatch (three uint), or null to dispatch
ThreadGroupCounts.
public Buffer IndirectArguments { get; set; }
Property Value
Remarks
The Buffer needs ArgumentBuffer (see Buffer.Argument). After a GPU
write, transition it to IndirectArgument before drawing this effect. The shader's
ThreadGroupCountGlobal still comes from ThreadGroupCounts.
IndirectArgumentsOffset
Gets or sets the byte offset of the thread group counts in IndirectArguments.
public int IndirectArgumentsOffset { get; set; }
Property Value
ShaderSourceName
Gets or sets the name of the input compute shader file (.sdsl)
public string ShaderSourceName { get; set; }
Property Value
ThreadGroupCounts
Gets or sets the number of thread groups to dispatch; total threads = ThreadGroupCounts × ThreadNumbers.
public Int3 ThreadGroupCounts { get; set; }
Property Value
ThreadNumbers
Gets or sets the compute shader's thread group size.
public Int3 ThreadNumbers { get; set; }
Property Value
Remarks
This is the shader's [numthreads(x, y, z)], applied through the ThreadNumberX/Y/Z macros
on CSMain. Keep consistent with ThreadGroupCounts.
Methods
DrawCore(RenderDrawContext)
Main drawing method for this renderer that must be implemented.
protected override void DrawCore(RenderDrawContext context)
Parameters
contextRenderDrawContextThe context.
PreDrawCore(RenderDrawContext)
protected override void PreDrawCore(RenderDrawContext context)
Parameters
contextRenderDrawContext
SetDefaultParameters()
Sets the default parameters (called at constructor time and if Reset() is called)
protected override void SetDefaultParameters()
UpdateParameters()
Updates the effect Parameters from properties defined in this instance. See remarks.
protected virtual void UpdateParameters()