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
mixinTreeShaderMixinSourceThe mixin tree.
compilerParametersParameterCollectionThe default property container.
registeredBuildersDictionary<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
paramKeyPermutationParameterKey<T>The parameter key.
Returns
- T
The value or default value associated to this parameter key.
Type Parameters
TType of the parameter value
Exceptions
Mixin(ShaderMixinSource, ShaderSource)
Mixins a ShaderMixinSource into the specified mixin tree.
public void Mixin(ShaderMixinSource mixinTree, ShaderSource shaderSource)
Parameters
mixinTreeShaderMixinSourceThe mixin tree.
shaderSourceShaderSourceThe shader source.
Mixin(ShaderMixinSource, string)
Mixins a ShaderMixinSource into the specified mixin tree.
public void Mixin(ShaderMixinSource mixinTree, string name)
Parameters
mixinTreeShaderMixinSourceThe mixin tree.
namestringThe 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
mixinTreeShaderMixinSourceThe mixin tree.
namestringThe name.
genericParametersobject[]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
mixinShaderMixinSourcecompositionNamestringcompositionShaderMixinSource
PushCompositionArray(ShaderMixinSource, string, ShaderMixinSource)
public void PushCompositionArray(ShaderMixinSource mixin, string compositionName, ShaderMixinSource composition)
Parameters
mixinShaderMixinSourcecompositionNamestringcompositionShaderMixinSource
PushParameters(ParameterCollection)
Pushes the current parameters collection being used.
public void PushParameters(ParameterCollection parameterCollection)
Parameters
parameterCollectionParameterCollectionThe property container.
RemoveMixin(ShaderMixinSource, string)
Removes the specified mixin from this instance.
public void RemoveMixin(ShaderMixinSource mixinTree, string name)
Parameters
mixinTreeShaderMixinSourceThe mixin tree.
namestringThe name.
SetParam<T>(PermutationParameterKey<T>, T)
public void SetParam<T>(PermutationParameterKey<T> key, T value)
Parameters
keyPermutationParameterKey<T>valueT
Type Parameters
T