EffectBytecode Class
Namespace: Stride.ShadersAssembly: Stride.Shaders.dll
Contains a compiled shader with bytecode for each stage.
[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. |
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[] |
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 |