Class EffectBytecode
Contains a compiled shader with bytecode for each stage.
[DataContract]
[ContentSerializer(typeof(DataContentSerializer<EffectBytecode>))]
public sealed class EffectBytecode
- Inheritance
-
EffectBytecode
Fields
HashSources
The used sources
public HashSourceCollection HashSources
Field Value
MagicHeader
Magic header stored in front of an effect bytecode to avoid reading old versions.
public const uint MagicHeader = 4026449927
Field Value
Remarks
If EffectBytecode is changed, this number must be changed manually.
Reflection
The reflection from the bytecode.
public EffectReflection Reflection
Field Value
Stages
The bytecode for each stage.
public ShaderBytecode[] Stages
Field Value
Methods
ComputeId()
Computes a unique identifier for this bytecode instance.
public ObjectId ComputeId()
Returns
- ObjectId
ObjectId.
FromBytes(byte[])
Loads an EffectBytecode from a buffer.
public static EffectBytecode FromBytes(byte[] buffer)
Parameters
buffer
byte[]The buffer.
Returns
- EffectBytecode
EffectBytecode.
Exceptions
- ArgumentNullException
buffer
FromBytesSafe(byte[])
Loads an EffectBytecode from a buffer.
public static EffectBytecode FromBytesSafe(byte[] buffer)
Parameters
buffer
byte[]The buffer.
Returns
- EffectBytecode
EffectBytecode.
Exceptions
- ArgumentNullException
buffer
FromStream(Stream)
Loads an EffectBytecode from a stream.
public static EffectBytecode FromStream(Stream stream)
Parameters
stream
StreamThe stream.
Returns
- EffectBytecode
EffectBytecode or null if the magic header is not matching
Exceptions
- ArgumentNullException
stream
WriteTo(Stream)
Writes this EffectBytecode to a stream with its magic number.
public void WriteTo(Stream stream)
Parameters
stream
StreamThe stream.
Exceptions
- ArgumentNullException
stream