Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

RDShaderSPIRV

繼承: Resource < RefCounted < Object

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

說明

RDShaderSPIRV represents an 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_any_hit

PackedByteArray()

PackedByteArray

bytecode_closest_hit

PackedByteArray()

PackedByteArray

bytecode_compute

PackedByteArray()

PackedByteArray

bytecode_fragment

PackedByteArray()

PackedByteArray

bytecode_intersection

PackedByteArray()

PackedByteArray

bytecode_miss

PackedByteArray()

PackedByteArray

bytecode_raygen

PackedByteArray()

PackedByteArray

bytecode_tesselation_control

PackedByteArray()

PackedByteArray

bytecode_tesselation_evaluation

PackedByteArray()

PackedByteArray

bytecode_vertex

PackedByteArray()

String

compile_error_any_hit

""

String

compile_error_closest_hit

""

String

compile_error_compute

""

String

compile_error_fragment

""

String

compile_error_intersection

""

String

compile_error_miss

""

String

compile_error_raygen

""

String

compile_error_tesselation_control

""

String

compile_error_tesselation_evaluation

""

String

compile_error_vertex

""

方法

PackedByteArray

get_stage_bytecode(stage: ShaderStage) const

String

get_stage_compile_error(stage: ShaderStage) const

void

set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)

void

set_stage_compile_error(stage: ShaderStage, compile_error: String)


屬性說明

PackedByteArray bytecode_any_hit = PackedByteArray() 🔗

The SPIR-V bytecode for the any hit 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_closest_hit = PackedByteArray() 🔗

The SPIR-V bytecode for the closest hit 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_compute = PackedByteArray() 🔗

計算著色器階段的 SPIR-V 位元組碼。

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() 🔗

片段著色器階段的 SPIR-V 位元組碼。

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_intersection = PackedByteArray() 🔗

The SPIR-V bytecode for the intersection 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_miss = PackedByteArray() 🔗

The SPIR-V bytecode for the miss 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_raygen = PackedByteArray() 🔗

The SPIR-V bytecode for the ray generation 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() 🔗

曲面細分控制著色器階段的 SPIR-V 位元組碼。

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() 🔗

曲面細分求值著色器階段的 SPIR-V 位元組碼。

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() 🔗

頂點著色器階段的 SPIR-V 位元組碼。

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_any_hit = "" 🔗

The compilation error message for the any hit shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.


String compile_error_closest_hit = "" 🔗

The compilation error message for the closest hit shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.


String compile_error_compute = "" 🔗

計算著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。


String compile_error_fragment = "" 🔗

片段著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。


String compile_error_intersection = "" 🔗

The compilation error message for the intersection shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.


String compile_error_miss = "" 🔗

The compilation error message for the miss shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.


String compile_error_raygen = "" 🔗

The compilation error message for the ray generation shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.


String compile_error_tesselation_control = "" 🔗

曲面細分控制著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。


String compile_error_tesselation_evaluation = "" 🔗

曲面細分求值著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。


String compile_error_vertex = "" 🔗

頂點著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。


方法說明

PackedByteArray get_stage_bytecode(stage: ShaderStage) const 🔗

等價於獲取 bytecode_computebytecode_fragmentbytecode_tesselation_controlbytecode_tesselation_evaluationbytecode_vertex 的其中之一。


String get_stage_compile_error(stage: ShaderStage) const 🔗

返回給定著色器階段 stage 的編譯錯誤消息。等價於獲取 compile_error_computecompile_error_fragmentcompile_error_tesselation_controlcompile_error_tesselation_evaluationcompile_error_vertex 的其中之一。


void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray) 🔗

設定給定著色器階段 stage 的 SPIR-V 位元組碼 bytecode。等價於設置 bytecode_computebytecode_fragmentbytecode_tesselation_controlbytecode_tesselation_evaluationbytecode_vertex 的其中之一。


void set_stage_compile_error(stage: ShaderStage, compile_error: String) 🔗

設定給定著色器階段 stage 的編譯錯誤消息。等價於設定 compile_error_computecompile_error_fragmentcompile_error_tesselation_controlcompile_error_tesselation_evaluationcompile_error_vertex 的其中之一。