Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    EffectBytecode Class

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

    Contains a compiled shader with bytecode for each stage.

    System.Object → EffectBytecode
    Derived from EffectBytecode:

    [DataContract]
    [ContentSerializer(typeof(DataContentSerializer<EffectBytecode>))]
    public sealed class EffectBytecode
    Name Description
    Fields
    HashSources

    The used sources

    MagicHeader

    Magic header stored in front of an effect bytecode to avoid reading old versions.

    Reflection

    The reflection from the bytecode.

    Stages

    The bytecode for each stage.

    Methods
    ComputeId()

    Computes a unique identifier for this bytecode instance.

    FromBytes(Byte[])

    Loads an EffectBytecode from a buffer.

    FromBytesSafe(Byte[])

    Loads an EffectBytecode from a buffer.

    FromStream(Stream)

    Loads an EffectBytecode from a stream.

    WriteTo(Stream)

    Writes this EffectBytecode to a stream with its magic number.

    | Improve this Doc View Source

    Fields


    HashSources

    The used sources

    public HashSourceCollection HashSources
    Field Value
    Type Description
    HashSourceCollection

    MagicHeader

    Magic header stored in front of an effect bytecode to avoid reading old versions.

    public const uint MagicHeader = 4026449927U
    Field Value
    Type Description
    System.UInt32
    Remarks

    If EffectBytecode is changed, this number must be changed manually.


    Reflection

    The reflection from the bytecode.

    public EffectReflection Reflection
    Field Value
    Type Description
    EffectReflection

    Stages

    The bytecode for each stage.

    public ShaderBytecode[] Stages
    Field Value
    Type Description
    ShaderBytecode[]
    | Improve this Doc View Source

    Methods


    ComputeId()

    Computes a unique identifier for this bytecode instance.

    public ObjectId ComputeId()
    Returns
    Type Description
    ObjectId

    ObjectId.


    FromBytes(Byte[])

    Loads an EffectBytecode from a buffer.

    public static EffectBytecode FromBytes(byte[] buffer)
    Parameters
    Type Name Description
    System.Byte[] buffer

    The buffer.

    Returns
    Type Description
    EffectBytecode

    EffectBytecode.

    Exceptions
    Type Condition
    System.ArgumentNullException

    buffer


    FromBytesSafe(Byte[])

    Loads an EffectBytecode from a buffer.

    public static EffectBytecode FromBytesSafe(byte[] buffer)
    Parameters
    Type Name Description
    System.Byte[] buffer

    The buffer.

    Returns
    Type Description
    EffectBytecode

    EffectBytecode.

    Exceptions
    Type Condition
    System.ArgumentNullException

    buffer


    FromStream(Stream)

    Loads an EffectBytecode from a stream.

    public static EffectBytecode FromStream(Stream stream)
    Parameters
    Type Name Description
    System.IO.Stream stream

    The stream.

    Returns
    Type Description
    EffectBytecode

    EffectBytecode or null if the magic header is not matching

    Exceptions
    Type Condition
    System.ArgumentNullException

    stream


    WriteTo(Stream)

    Writes this EffectBytecode to a stream with its magic number.

    public void WriteTo(Stream stream)
    Parameters
    Type Name Description
    System.IO.Stream stream

    The stream.

    Exceptions
    Type Condition
    System.ArgumentNullException

    stream


    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