ShaderMixinContext Class
Namespace: Stride.ShadersAssembly: Stride.Shaders.dll
A context used when mixin ShaderSource.
public class 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
| Type | Name | Description | 
|---|---|---|
| ShaderMixinSource | mixinTree | The mixin tree.  | 
                  
| ParameterCollection | compilerParameters | The default property container.  | 
                  
| System.Collections.Generic.Dictionary<System.String, IShaderMixinBuilder> | registeredBuilders | The registered builders.  | 
                  
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentNullException | compilerParameters or registeredBuilders  | 
                  
Properties
ChildEffectName
Gets or sets the child effect.
public string ChildEffectName { get; set; }
              Property Value
| Type | Description | 
|---|---|
| System.String | The child effect.  | 
                  
CurrentMixin
public ShaderMixinSource CurrentMixin { get; }
              Property Value
| Type | Description | 
|---|---|
| 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
| Type | Name | Description | 
|---|---|---|
| PermutationParameterKey<T> | paramKey | The parameter key.  | 
                  
Returns
| Type | Description | 
|---|---|
| T | The value or default value associated to this parameter key.  | 
                  
Type Parameters
| Name | Description | 
|---|---|
| T | Type of the parameter value  | 
                  
Exceptions
| Type | Condition | 
|---|---|
| System.ArgumentNullException | key  | 
                  
Mixin(ShaderMixinSource, ShaderSource)
Mixins a ShaderMixinSource into the specified mixin tree.
public void Mixin(ShaderMixinSource mixinTree, ShaderSource shaderSource)
              Parameters
| Type | Name | Description | 
|---|---|---|
| ShaderMixinSource | mixinTree | 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
| Type | Name | Description | 
|---|---|---|
| ShaderMixinSource | mixinTree | The mixin tree.  | 
                  
| System.String | name | The name.  | 
                  
Mixin(ShaderMixinSource, String, 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
| Type | Name | Description | 
|---|---|---|
| ShaderMixinSource | mixinTree | The mixin tree.  | 
                  
| System.String | name | The name.  | 
                  
| System.Object[] | genericParameters | The generic parameters.  | 
                  
Exceptions
| Type | Condition | 
|---|---|
| System.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
| Type | Name | Description | 
|---|---|---|
| ShaderMixinSource | mixin | |
| System.String | compositionName | |
| ShaderMixinSource | composition | 
PushCompositionArray(ShaderMixinSource, String, ShaderMixinSource)
public void PushCompositionArray(ShaderMixinSource mixin, string compositionName, ShaderMixinSource composition)
              Parameters
| Type | Name | Description | 
|---|---|---|
| ShaderMixinSource | mixin | |
| System.String | compositionName | |
| ShaderMixinSource | composition | 
PushParameters(ParameterCollection)
Pushes the current parameters collection being used.
public void PushParameters(ParameterCollection parameterCollection)
              Parameters
| Type | Name | Description | 
|---|---|---|
| ParameterCollection | parameterCollection | The property container.  | 
                  
RemoveMixin(ShaderMixinSource, String)
Removes the specified mixin from this instance.
public void RemoveMixin(ShaderMixinSource mixinTree, string name)
              Parameters
| Type | Name | Description | 
|---|---|---|
| ShaderMixinSource | mixinTree | The mixin tree.  | 
                  
| System.String | name | The name.  | 
                  
SetParam<T>(PermutationParameterKey<T>, T)
public void SetParam<T>(PermutationParameterKey<T> key, T value)
              Parameters
| Type | Name | Description | 
|---|---|---|
| PermutationParameterKey<T> | key | |
| T | value | 
Type Parameters
| Name | Description | 
|---|---|
| T |