Table of Contents

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
object
ComputeEffectShader
Implements
Inherited Members
Extension Methods

Constructors

ComputeEffectShader(RenderContext)

public ComputeEffectShader(RenderContext context)

Parameters

context RenderContext

Properties

EffectInstance

The current effect instance.

public DynamicEffectInstance EffectInstance { get; }

Property Value

DynamicEffectInstance

ShaderSourceName

Gets or sets the name of the input compute shader file (.sdsl)

public string ShaderSourceName { get; set; }

Property Value

string

ThreadGroupCounts

Gets or sets the number of thread groups to dispatch; total threads = ThreadGroupCounts × ThreadNumbers.

public Int3 ThreadGroupCounts { get; set; }

Property Value

Int3

ThreadNumbers

Gets or sets the compute shader's thread group size.

public Int3 ThreadNumbers { get; set; }

Property Value

Int3

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

context RenderDrawContext

The context.

PreDrawCore(RenderDrawContext)

protected override void PreDrawCore(RenderDrawContext context)

Parameters

context RenderDrawContext

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()