Class RDShaderSPIRV
SPIR-V intermediate representation as part of a RDShaderFile (used by RenderingDevice).
- Inheritance
-
RDShaderSPIRV
Remarks
RDShaderSPIRV represents a RDShaderFile's SPIR-V code for various shader stages, as well as possible compilation error messages. SPIR-V is a low-level intermediate shader representation. This intermediate representation is not used directly by GPUs for rendering, but it can be compiled into binary shaders that GPUs can understand. Unlike compiled shaders, SPIR-V is portable across GPU models and driver versions.
This object is used by RenderingDevice.
Properties
bytecode_compute
The SPIR-V bytecode for the compute shader stage.
var bytecode_compute : PackedByteArray = PackedByteArray()
Property Value
Remarks
- void set_stage_bytecode(int stage, PackedByteArray bytecode)
- PackedByteArray get_stage_bytecode(int stage)
bytecode_fragment
The SPIR-V bytecode for the fragment shader stage.
var bytecode_fragment : PackedByteArray = PackedByteArray()
Property Value
Remarks
- void set_stage_bytecode(int stage, PackedByteArray bytecode)
- PackedByteArray get_stage_bytecode(int stage)
bytecode_tesselation_control
The SPIR-V bytecode for the tessellation control shader stage.
var bytecode_tesselation_control : PackedByteArray = PackedByteArray()
Property Value
Remarks
- void set_stage_bytecode(int stage, PackedByteArray bytecode)
- PackedByteArray get_stage_bytecode(int stage)
bytecode_tesselation_evaluation
The SPIR-V bytecode for the tessellation evaluation shader stage.
var bytecode_tesselation_evaluation : PackedByteArray = PackedByteArray()
Property Value
Remarks
- void set_stage_bytecode(int stage, PackedByteArray bytecode)
- PackedByteArray get_stage_bytecode(int stage)
bytecode_vertex
The SPIR-V bytecode for the vertex shader stage.
var bytecode_vertex : PackedByteArray = PackedByteArray()
Property Value
Remarks
- void set_stage_bytecode(int stage, PackedByteArray bytecode)
- PackedByteArray get_stage_bytecode(int stage)
compile_error_compute
The compilation error message for the compute shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
var compile_error_compute : String = ""
Property Value
Remarks
compile_error_fragment
The compilation error message for the fragment shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
var compile_error_fragment : String = ""
Property Value
Remarks
compile_error_tesselation_control
The compilation error message for the tessellation control shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
var compile_error_tesselation_control : String = ""
Property Value
Remarks
compile_error_tesselation_evaluation
The compilation error message for the tessellation evaluation shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
var compile_error_tesselation_evaluation : String = ""
Property Value
Remarks
compile_error_vertex
The compilation error message for the vertex shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
var compile_error_vertex : String = ""
Property Value
Remarks
Methods
get_stage_bytecode(int)
Qualifiers: const
Equivalent to getting one of bytecode_compute, bytecode_fragment, bytecode_tesselation_control, bytecode_tesselation_evaluation, bytecode_vertex.
PackedByteArray get_stage_bytecode(int stage)
Parameters
stage
int
get_stage_compile_error(int)
Qualifiers: const
Returns the compilation error message for the given shader stage
. Equivalent to getting one of compile_error_compute, compile_error_fragment, compile_error_tesselation_control, compile_error_tesselation_evaluation, compile_error_vertex.
String get_stage_compile_error(int stage)
Parameters
stage
int
set_stage_bytecode(int, PackedByteArray)
Sets the SPIR-V bytecode
for the given shader stage
. Equivalent to setting one of bytecode_compute, bytecode_fragment, bytecode_tesselation_control, bytecode_tesselation_evaluation, bytecode_vertex.
void set_stage_bytecode(int stage, PackedByteArray bytecode)
Parameters
stage
intbytecode
PackedByteArray
set_stage_compile_error(int, String)
Sets the compilation error message for the given shader stage
to compile_error
. Equivalent to setting one of compile_error_compute, compile_error_fragment, compile_error_tesselation_control, compile_error_tesselation_evaluation, compile_error_vertex.
void set_stage_compile_error(int stage, String compile_error)