Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    ParameterCollection Class

    Namespace: Stride.Rendering
    Assembly: Stride.dll

    Manage several effect parameters (resources and data). A specific data and resource layout can be forced (usually by the consuming effect).

    System.Object → ParameterCollection
    Derived from ParameterCollection: CompilerParameters ShaderMixinParameters

    [DataSerializer(typeof(ParameterCollection.Serializer))]
    [DataSerializerGlobal(null, typeof(FastList<ParameterKeyInfo>), DataSerializerGenericMode.None, false, false)]
    public class ParameterCollection
    Name Description
    Constructors
    ParameterCollection()
    ParameterCollection(ParameterCollection)
    Fields
    DataValues
    LayoutCounter
    ObjectValues
    PermutationCounter
    Properties
    HasLayout
    Layout
    ParameterKeyInfos
    Methods
    Clear()

    Clears the collection, including the layout.

    ContainsKey(ParameterKey)

    Determines whether current collection contains a value for this key.

    CopyTo<T>(ValueParameterKey<T>, ParameterCollection, ValueParameterKey<T>)

    Copies all blittable values of a given key to the specified ParameterCollection.

    Get<T>(ObjectParameterAccessor<T>)

    Gets an object.

    Get<T>(ObjectParameterKey<T>, Boolean)

    Gets an object.

    Get<T>(PermutationParameter<T>)

    Gets a permutation.

    Get<T>(PermutationParameterKey<T>, Boolean)

    Gets a permutation.

    Get<T>(ValueParameter<T>)

    Gets a value.

    Get<T>(ValueParameterKey<T>)

    Gets a blittable value.

    GetAccessor<T>(ObjectParameterKey<T>, Boolean)

    Gets an accessor to get and set objects more quickly.

    GetAccessor<T>(PermutationParameterKey<T>, Boolean)

    Gets an accessor to get and set permutations more quickly.

    GetAccessor<T>(ValueParameterKey<T>, Int32)

    Gets an accessor to get and set blittable values more quickly.

    GetObject(ParameterKey)
    GetObjectParameterHelper(ParameterKey, Boolean)
    GetValues<T>(ValueParameterKey<T>)

    Gets blittable values.

    Remove(ParameterKey)
    Set<T>(ObjectParameterAccessor<T>, T)

    Sets an object.

    Set<T>(ObjectParameterKey<T>, T)

    Sets an object.

    Set<T>(PermutationParameter<T>, T)

    Sets a permutation.

    Set<T>(PermutationParameterKey<T>, T)

    Sets a permutation.

    Set<T>(ValueParameter<T>, T)

    Sets a blittable value.

    Set<T>(ValueParameter<T>, ref T)

    Sets a blittable value.

    Set<T>(ValueParameter<T>, Int32, ref T)

    Sets blittable values.

    Set<T>(ValueParameterKey<T>, T)

    Sets a blittable value.

    Set<T>(ValueParameterKey<T>, ref T)

    Sets a blittable value.

    Set<T>(ValueParameterKey<T>, T[])

    Sets blittable values.

    Set<T>(ValueParameterKey<T>, Int32, ref T)

    Sets blittable values.

    SetObject(ParameterKey, Object)
    ToString()
    UpdateLayout(ParameterCollectionLayout)

    Reorganizes internal data and resources to match the given objects, and append extra values at the end.

    | Improve this Doc View Source

    Constructors


    ParameterCollection()

    public ParameterCollection()

    ParameterCollection(ParameterCollection)

    public ParameterCollection(ParameterCollection parameterCollection)
    Parameters
    Type Name Description
    ParameterCollection parameterCollection
    | Improve this Doc View Source

    Fields


    DataValues

    public byte[] DataValues
    Field Value
    Type Description
    System.Byte[]

    LayoutCounter

    public int LayoutCounter
    Field Value
    Type Description
    System.Int32

    ObjectValues

    public object[] ObjectValues
    Field Value
    Type Description
    System.Object[]

    PermutationCounter

    public int PermutationCounter
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Properties


    HasLayout

    public bool HasLayout { get; }
    Property Value
    Type Description
    System.Boolean

    Layout

    public ParameterCollectionLayout Layout { get; }
    Property Value
    Type Description
    ParameterCollectionLayout

    ParameterKeyInfos

    public FastList<ParameterKeyInfo> ParameterKeyInfos { get; }
    Property Value
    Type Description
    FastList<ParameterKeyInfo>
    | Improve this Doc View Source

    Methods


    Clear()

    Clears the collection, including the layout.

    public void Clear()

    ContainsKey(ParameterKey)

    Determines whether current collection contains a value for this key.

    public bool ContainsKey(ParameterKey key)
    Parameters
    Type Name Description
    ParameterKey key
    Returns
    Type Description
    System.Boolean

    CopyTo<T>(ValueParameterKey<T>, ParameterCollection, ValueParameterKey<T>)

    Copies all blittable values of a given key to the specified ParameterCollection.

    public void CopyTo<T>(ValueParameterKey<T> key, ParameterCollection destination, ValueParameterKey<T> destinationKey)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> key

    The key for the values to copy.

    ParameterCollection destination

    The collection to copy the values to.

    ValueParameterKey<T> destinationKey

    The key for the values of the destination collection.

    Type Parameters
    Name Description
    T

    Get<T>(ObjectParameterAccessor<T>)

    Gets an object.

    public T Get<T>(ObjectParameterAccessor<T> parameterAccessor)
    Parameters
    Type Name Description
    ObjectParameterAccessor<T> parameterAccessor
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Get<T>(ObjectParameterKey<T>, Boolean)

    Gets an object.

    public T Get<T>(ObjectParameterKey<T> parameter, bool createIfNew = false)
    Parameters
    Type Name Description
    ObjectParameterKey<T> parameter
    System.Boolean createIfNew
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Get<T>(PermutationParameter<T>)

    Gets a permutation.

    public T Get<T>(PermutationParameter<T> parameter)
    Parameters
    Type Name Description
    PermutationParameter<T> parameter
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Get<T>(PermutationParameterKey<T>, Boolean)

    Gets a permutation.

    public T Get<T>(PermutationParameterKey<T> parameter, bool createIfNew = false)
    Parameters
    Type Name Description
    PermutationParameterKey<T> parameter
    System.Boolean createIfNew
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Get<T>(ValueParameter<T>)

    Gets a value.

    public T Get<T>(ValueParameter<T> parameter)
        where T : struct
    Parameters
    Type Name Description
    ValueParameter<T> parameter
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    Get<T>(ValueParameterKey<T>)

    Gets a blittable value.

    public T Get<T>(ValueParameterKey<T> parameter)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> parameter
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    GetAccessor<T>(ObjectParameterKey<T>, Boolean)

    Gets an accessor to get and set objects more quickly.

    public ObjectParameterAccessor<T> GetAccessor<T>(ObjectParameterKey<T> parameterKey, bool createIfNew = true)
    Parameters
    Type Name Description
    ObjectParameterKey<T> parameterKey
    System.Boolean createIfNew
    Returns
    Type Description
    ObjectParameterAccessor<T>
    Type Parameters
    Name Description
    T

    GetAccessor<T>(PermutationParameterKey<T>, Boolean)

    Gets an accessor to get and set permutations more quickly.

    public PermutationParameter<T> GetAccessor<T>(PermutationParameterKey<T> parameterKey, bool createIfNew = true)
    Parameters
    Type Name Description
    PermutationParameterKey<T> parameterKey
    System.Boolean createIfNew
    Returns
    Type Description
    PermutationParameter<T>
    Type Parameters
    Name Description
    T

    GetAccessor<T>(ValueParameterKey<T>, Int32)

    Gets an accessor to get and set blittable values more quickly.

    public ValueParameter<T> GetAccessor<T>(ValueParameterKey<T> parameterKey, int elementCount = 1)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> parameterKey
    System.Int32 elementCount
    Returns
    Type Description
    ValueParameter<T>
    Type Parameters
    Name Description
    T

    GetObject(ParameterKey)

    public object GetObject(ParameterKey key)
    Parameters
    Type Name Description
    ParameterKey key
    Returns
    Type Description
    System.Object

    GetObjectParameterHelper(ParameterKey, Boolean)

    protected ParameterCollection.Accessor GetObjectParameterHelper(ParameterKey parameterKey, bool createIfNew = true)
    Parameters
    Type Name Description
    ParameterKey parameterKey
    System.Boolean createIfNew
    Returns
    Type Description
    ParameterCollection.Accessor

    GetValues<T>(ValueParameterKey<T>)

    Gets blittable values.

    public T[] GetValues<T>(ValueParameterKey<T> key)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> key
    Returns
    Type Description
    T[]
    Type Parameters
    Name Description
    T

    Remove(ParameterKey)

    public bool Remove(ParameterKey key)
    Parameters
    Type Name Description
    ParameterKey key
    Returns
    Type Description
    System.Boolean

    Set<T>(ObjectParameterAccessor<T>, T)

    Sets an object.

    public void Set<T>(ObjectParameterAccessor<T> parameterAccessor, T value)
    Parameters
    Type Name Description
    ObjectParameterAccessor<T> parameterAccessor
    T value
    Type Parameters
    Name Description
    T

    Set<T>(ObjectParameterKey<T>, T)

    Sets an object.

    public void Set<T>(ObjectParameterKey<T> parameter, T value)
    Parameters
    Type Name Description
    ObjectParameterKey<T> parameter
    T value
    Type Parameters
    Name Description
    T

    Set<T>(PermutationParameter<T>, T)

    Sets a permutation.

    public void Set<T>(PermutationParameter<T> parameter, T value)
    Parameters
    Type Name Description
    PermutationParameter<T> parameter
    T value
    Type Parameters
    Name Description
    T

    Set<T>(PermutationParameterKey<T>, T)

    Sets a permutation.

    public void Set<T>(PermutationParameterKey<T> parameter, T value)
    Parameters
    Type Name Description
    PermutationParameterKey<T> parameter
    T value
    Type Parameters
    Name Description
    T

    Set<T>(ValueParameter<T>, T)

    Sets a blittable value.

    public void Set<T>(ValueParameter<T> parameter, T value)
        where T : struct
    Parameters
    Type Name Description
    ValueParameter<T> parameter
    T value
    Type Parameters
    Name Description
    T

    Set<T>(ValueParameter<T>, ref T)

    Sets a blittable value.

    public void Set<T>(ValueParameter<T> parameter, ref T value)
        where T : struct
    Parameters
    Type Name Description
    ValueParameter<T> parameter
    T value
    Type Parameters
    Name Description
    T

    Set<T>(ValueParameter<T>, Int32, ref T)

    Sets blittable values.

    public void Set<T>(ValueParameter<T> parameter, int count, ref T firstValue)
        where T : struct
    Parameters
    Type Name Description
    ValueParameter<T> parameter
    System.Int32 count
    T firstValue
    Type Parameters
    Name Description
    T

    Set<T>(ValueParameterKey<T>, T)

    Sets a blittable value.

    public void Set<T>(ValueParameterKey<T> parameter, T value)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> parameter
    T value
    Type Parameters
    Name Description
    T

    Set<T>(ValueParameterKey<T>, ref T)

    Sets a blittable value.

    public void Set<T>(ValueParameterKey<T> parameter, ref T value)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> parameter
    T value
    Type Parameters
    Name Description
    T

    Set<T>(ValueParameterKey<T>, T[])

    Sets blittable values.

    public void Set<T>(ValueParameterKey<T> parameter, T[] values)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> parameter
    T[] values
    Type Parameters
    Name Description
    T

    Set<T>(ValueParameterKey<T>, Int32, ref T)

    Sets blittable values.

    public void Set<T>(ValueParameterKey<T> parameter, int count, ref T firstValue)
        where T : struct
    Parameters
    Type Name Description
    ValueParameterKey<T> parameter
    System.Int32 count
    T firstValue
    Type Parameters
    Name Description
    T

    SetObject(ParameterKey, Object)

    public void SetObject(ParameterKey key, object value)
    Parameters
    Type Name Description
    ParameterKey key
    System.Object value

    ToString()

    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    UpdateLayout(ParameterCollectionLayout)

    Reorganizes internal data and resources to match the given objects, and append extra values at the end.

    public void UpdateLayout(ParameterCollectionLayout collectionLayout)
    Parameters
    Type Name Description
    ParameterCollectionLayout collectionLayout

    Extension Methods

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

    Back to top

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