Class ShaderMixinContext
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
ShaderMixinSourceThe mixin tree.
compilerParameters
ParameterCollectionThe 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
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
Mixin(ShaderMixinSource, ShaderSource)
Mixins a ShaderMixinSource into the specified mixin tree.
public void Mixin(ShaderMixinSource mixinTree, ShaderSource shaderSource)
Parameters
mixinTree
ShaderMixinSourceThe mixin tree.
shaderSource
ShaderSourceThe shader source.
Mixin(ShaderMixinSource, string)
Mixins a ShaderMixinSource into the specified mixin tree.
public void Mixin(ShaderMixinSource mixinTree, string name)
Parameters
mixinTree
ShaderMixinSourceThe mixin tree.
name
stringThe 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
ShaderMixinSourceThe mixin tree.
name
stringThe 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
ShaderMixinSourcecompositionName
stringcomposition
ShaderMixinSource
PushCompositionArray(ShaderMixinSource, string, ShaderMixinSource)
public void PushCompositionArray(ShaderMixinSource mixin, string compositionName, ShaderMixinSource composition)
Parameters
mixin
ShaderMixinSourcecompositionName
stringcomposition
ShaderMixinSource
PushParameters(ParameterCollection)
Pushes the current parameters collection being used.
public void PushParameters(ParameterCollection parameterCollection)
Parameters
parameterCollection
ParameterCollectionThe property container.
RemoveMixin(ShaderMixinSource, string)
Removes the specified mixin from this instance.
public void RemoveMixin(ShaderMixinSource mixinTree, string name)
Parameters
mixinTree
ShaderMixinSourceThe mixin tree.
name
stringThe name.
SetParam<T>(PermutationParameterKey<T>, T)
public void SetParam<T>(PermutationParameterKey<T> key, T value)
Parameters
key
PermutationParameterKey<T>value
T
Type Parameters
T