RDShaderSPIRV

继承: Resource < RefCounted < Object

SPIR-V intermediate representation as part of a RDShaderFile (used by RenderingDevice).

描述

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.

属性

方法


属性说明

PackedByteArray bytecode_compute = PackedByteArray()

The SPIR-V bytecode for the compute shader stage.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedByteArray for more details.


PackedByteArray bytecode_fragment = PackedByteArray()

The SPIR-V bytecode for the fragment shader stage.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedByteArray for more details.


PackedByteArray bytecode_tesselation_control = PackedByteArray()

The SPIR-V bytecode for the tessellation control shader stage.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedByteArray for more details.


PackedByteArray bytecode_tesselation_evaluation = PackedByteArray()

The SPIR-V bytecode for the tessellation evaluation shader stage.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedByteArray for more details.


PackedByteArray bytecode_vertex = PackedByteArray()

The SPIR-V bytecode for the vertex shader stage.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedByteArray for more details.


String 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.


String 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.


String 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.


String 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.


String 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.


方法说明

PackedByteArray get_stage_bytecode ( stage: ShaderStage ) const1

Equivalent to getting one of bytecode_compute, bytecode_fragment, bytecode_tesselation_control, bytecode_tesselation_evaluation, bytecode_vertex.


String get_stage_compile_error ( stage: ShaderStage ) const1

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.


void set_stage_bytecode ( stage: ShaderStage, bytecode: 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_compile_error ( stage: ShaderStage, compile_error: 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.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。