Class EffectBytecode
Represents a compiled Effect with bytecode for each Shader stage (vertex, pixel, geometry, etc.)
[DataContract]
[ContentSerializer(typeof(DataContentSerializer<EffectBytecode>))]
public sealed class EffectBytecode
- Inheritance
-
objectEffectBytecode
- Extension Methods
Fields
HashSources
A collection of each of the Effect Shader source URIs and their associated ObjectIds.
public HashSourceCollection HashSources
Field Value
MagicHeader
A constant value representing the magic header stored in front of an Effect bytecode to avoid reading old versions.
public const uint MagicHeader = 4026449927
Field Value
Reflection
The reflection data extracted from the Effect bytecode.
public EffectReflection Reflection
Field Value
Stages
The Effect bytecode for each of the Shader stages.
public ShaderBytecode[] Stages
Field Value
Methods
ComputeId()
Computes a unique identifier for the Effect bytecode.
public ObjectId ComputeId()
Returns
FromBytes(byte[])
Loads an EffectBytecode from a buffer.
public static EffectBytecode FromBytes(byte[] buffer)
Parameters
bufferbyte[]The buffer to read from.
Returns
- EffectBytecode
The loaded Effect bytecode.
Exceptions
- ArgumentNullException
bufferis null.
FromBytesSafe(byte[])
Loads an EffectBytecode from a buffer.
public static EffectBytecode FromBytesSafe(byte[] buffer)
Parameters
bufferbyte[]The buffer to read from.
Returns
- EffectBytecode
The loaded Effect bytecode.
Exceptions
- ArgumentNullException
bufferis null.- ArgumentException
buffercontains invalid Effect bytecode.
FromStream(Stream)
Loads an EffectBytecode from a stream.
public static EffectBytecode FromStream(Stream stream)
Parameters
streamStreamThe stream to read from.
Returns
- EffectBytecode
The loaded Effect bytecode, or null if the magic header is not matching.
Exceptions
- ArgumentNullException
streamis null.
WriteTo(Stream)
Writes the EffectBytecode to a stream with its magic number.
public void WriteTo(Stream stream)
Parameters
streamStreamThe stream to write to.
Exceptions
- ArgumentNullException
streamis null.