Table of Contents

Class ShaderMixinContext

Namespace
Stride.Shaders
Assembly
Stride.Shaders.dll

A context used when mixin ShaderSource.

public class ShaderMixinContext
Inheritance
ShaderMixinContext

Constructors

ShaderMixinContext(ShaderMixinSource, ParameterCollection, Dictionary<string, IShaderMixinBuilder>)

Initializes a new instance of the ShaderMixinContext class.

public ShaderMixinContext(ShaderMixinSource mixinTree, ParameterCollection compilerParameters, Dictionary<string, IShaderMixinBuilder> registeredBuilders)

Parameters

mixinTree ShaderMixinSource

The mixin tree.

compilerParameters ParameterCollection

The default property container.

registeredBuilders Dictionary<string, IShaderMixinBuilder>

The registered builders.

Exceptions

ArgumentNullException

compilerParameters or registeredBuilders

Properties

ChildEffectName

Gets or sets the child effect.

public string ChildEffectName { get; set; }

Property Value

string

The child effect.

CurrentMixin

public ShaderMixinSource CurrentMixin { get; }

Property Value

ShaderMixinSource

Methods

Discard()

public void Discard()

GetParam<T>(PermutationParameterKey<T>)

Gets a parameter value for the specified key.

public T GetParam<T>(PermutationParameterKey<T> paramKey)

Parameters

paramKey PermutationParameterKey<T>

The parameter key.

Returns

T

The value or default value associated to this parameter key.

Type Parameters

T

Type of the parameter value

Exceptions

ArgumentNullException

key

Mixin(ShaderMixinSource, ShaderSource)

Mixins a ShaderMixinSource into the specified mixin tree.

public void Mixin(ShaderMixinSource mixinTree, ShaderSource shaderSource)

Parameters

mixinTree ShaderMixinSource

The mixin tree.

shaderSource ShaderSource

The shader source.

Mixin(ShaderMixinSource, string)

Mixins a ShaderMixinSource into the specified mixin tree.

public void Mixin(ShaderMixinSource mixinTree, string name)

Parameters

mixinTree ShaderMixinSource

The mixin tree.

name string

The name.

Mixin(ShaderMixinSource, string, params object[])

Mixins a ShaderClassSource identified by its name/generic parameters into the specified mixin tree.

public void Mixin(ShaderMixinSource mixinTree, string name, params object[] genericParameters)

Parameters

mixinTree ShaderMixinSource

The mixin tree.

name string

The name.

genericParameters object[]

The generic parameters.

Exceptions

InvalidOperationException

If the class source doesn't support generic parameters

PopComposition()

public void PopComposition()

PopParameters()

Pops the parameters collection.

public void PopParameters()

PushComposition(ShaderMixinSource, string, ShaderMixinSource)

public void PushComposition(ShaderMixinSource mixin, string compositionName, ShaderMixinSource composition)

Parameters

mixin ShaderMixinSource
compositionName string
composition ShaderMixinSource

PushCompositionArray(ShaderMixinSource, string, ShaderMixinSource)

public void PushCompositionArray(ShaderMixinSource mixin, string compositionName, ShaderMixinSource composition)

Parameters

mixin ShaderMixinSource
compositionName string
composition ShaderMixinSource

PushParameters(ParameterCollection)

Pushes the current parameters collection being used.

public void PushParameters(ParameterCollection parameterCollection)

Parameters

parameterCollection ParameterCollection

The property container.

RemoveMixin(ShaderMixinSource, string)

Removes the specified mixin from this instance.

public void RemoveMixin(ShaderMixinSource mixinTree, string name)

Parameters

mixinTree ShaderMixinSource

The mixin tree.

name string

The name.

SetParam<T>(PermutationParameterKey<T>, T)

public void SetParam<T>(PermutationParameterKey<T> key, T value)

Parameters

key PermutationParameterKey<T>
value T

Type Parameters

T