Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ShaderMixinContext Class

    Namespace: Stride.Shaders
    Assembly: Stride.Shaders.dll

    A context used when mixin ShaderSource.

    System.Object → ShaderMixinContext
    Derived from ShaderMixinContext:

    public class ShaderMixinContext
    Name Description
    Constructors
    ShaderMixinContext(ShaderMixinSource, ParameterCollection, Dictionary<String, IShaderMixinBuilder>)

    Initializes a new instance of the ShaderMixinContext class.

    Properties
    ChildEffectName

    Gets or sets the child effect.

    CurrentMixin
    Methods
    Discard()
    GetParam<T>(PermutationParameterKey<T>)

    Gets a parameter value for the specified key.

    Mixin(ShaderMixinSource, ShaderSource)

    Mixins a ShaderMixinSource into the specified mixin tree.

    Mixin(ShaderMixinSource, String)

    Mixins a ShaderMixinSource into the specified mixin tree.

    Mixin(ShaderMixinSource, String, Object[])

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

    PopComposition()
    PopParameters()

    Pops the parameters collection.

    PushComposition(ShaderMixinSource, String, ShaderMixinSource)
    PushCompositionArray(ShaderMixinSource, String, ShaderMixinSource)
    PushParameters(ParameterCollection)

    Pushes the current parameters collection being used.

    RemoveMixin(ShaderMixinSource, String)

    Removes the specified mixin from this instance.

    SetParam<T>(PermutationParameterKey<T>, T)
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation