Table of Contents

Class ShaderBytecode

Namespace
Stride.Shaders
Assembly
Stride.Shaders.dll

Represents a compiled Shader bytecode.

[DataContract]
public class ShaderBytecode
Inheritance
object
ShaderBytecode
Extension Methods

Constructors

ShaderBytecode()

Initializes a new instance of the ShaderBytecode class.

public ShaderBytecode()

ShaderBytecode(ObjectId, byte[])

Initializes a new instance of the ShaderBytecode class.

public ShaderBytecode(ObjectId id, byte[] data)

Parameters

id ObjectId

An unique identifier for the compiled Shader bytecode data.

data byte[]

The compiled Shader bytecode data.

Fields

Stage

The stage of this Shader bytecode.

public ShaderStage Stage

Field Value

ShaderStage

Properties

Data

Gets or sets the compiled Shader bytecode data that should be used to create the Shader.

public byte[] Data { get; set; }

Property Value

byte[]

Id

Gets or sets an unique identifier for the Shader bytecode.

public ObjectId Id { get; set; }

Property Value

ObjectId

Methods

Clone()

Creates a shallow copy of the current ShaderBytecode.

public ShaderBytecode Clone()

Returns

ShaderBytecode

A shallow copy of the current instance.

GetDataAsString()

Gets the Shader data as a string. In some platforms (e.g. OpenGL), the data represents the GLSL source code, instead of compiled bytecode.

public string GetDataAsString()

Returns

string

The Shader data as GLSL source code.

Operators

implicit operator byte[](ShaderBytecode)

Performs an implicit conversion from ShaderBytecode to byte[], returning the compiled Shader data.

public static implicit operator byte[](ShaderBytecode shaderBytecode)

Parameters

shaderBytecode ShaderBytecode

The compiled Shader bytecode.

Returns

byte[]

The compiled Shader bytecode data converted to a byte array.