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.
Checking the stable version of the documentation...
RDShaderSPIRV
繼承: Resource < RefCounted < Object
SPIR-V 中間表示,是 RDShaderFile 的一部分(由 RenderingDevice 使用)。
說明
RDShaderSPIRV 代表 RDShaderFile 不同著色器階段的 SPIR-V 程式碼,以及可能的編譯錯誤訊息。SPIR-V 是一種低階著色器中間表示。這種中間表示無法直接用於 GPU 渲染,但可以被編譯為 GPU 能夠理解的二進位著色器。與編譯後的著色器不同,SPIR-V 可以在不同 GPU 型號以及驅動版本之間移植。
這個物件由 RenderingDevice 使用。
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
get_stage_bytecode(stage: ShaderStage) const |
|
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() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
任意命中著色器階段的 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_closest_hit = PackedByteArray() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
最近命中著色器階段的 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_compute = PackedByteArray() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
計算著色器階段的 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() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
片段著色器階段的 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() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
相交著色器階段的 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_miss = PackedByteArray() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
未命中著色器階段的 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_raygen = PackedByteArray() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
光線生成著色器階段的 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_control = PackedByteArray() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
曲面細分控制著色器階段的 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() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
曲面細分求值著色器階段的 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() 🔗
void set_stage_bytecode(stage: ShaderStage, bytecode: PackedByteArray)
PackedByteArray get_stage_bytecode(stage: ShaderStage) const
頂點著色器階段的 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 = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
“任意命中”著色器階段的編譯錯誤訊息(由 SPIR-V 編譯器和 Godot 設定)。如果這裡為空,則說明著色器編譯成功。
String compile_error_closest_hit = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
“最近命中”著色器階段的編譯錯誤訊息(由 SPIR-V 編譯器和 Godot 引擎提供)。如果此處為空,則說明著色器編譯成功。
String compile_error_compute = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
計算著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。
String compile_error_fragment = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
片段著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。
String compile_error_intersection = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
“相交”著色器階段的編譯錯誤訊息(由 SPIR-V 編譯器和 Godot 引擎提供)。如果此處為空,則說明著色器編譯成功。
String compile_error_miss = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
“未命中”著色器階段的編譯錯誤訊息(由 SPIR-V 編譯器和 Godot 引擎提供)。如果此處為空,則說明著色器編譯成功。
String compile_error_raygen = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
光線生成著色器階段的編譯錯誤訊息(由 SPIR-V 編譯器和 Godot 設定)。如果此處為空,則表示著色器編譯成功。
String compile_error_tesselation_control = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
曲面細分控制著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。
String compile_error_tesselation_evaluation = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
曲面細分求值著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。
String compile_error_vertex = "" 🔗
void set_stage_compile_error(stage: ShaderStage, compile_error: String)
String get_stage_compile_error(stage: ShaderStage) const
頂點著色器階段的編譯錯誤資訊(由 SPIR-V 編譯器和 Godot 設定)。如果為空,則著色器成功編譯。
方法說明
PackedByteArray get_stage_bytecode(stage: ShaderStage) const 🔗
等價於取得 bytecode_compute、bytecode_fragment、bytecode_tesselation_control、bytecode_tesselation_evaluation、bytecode_vertex 的其中之一。
String get_stage_compile_error(stage: ShaderStage) const 🔗
返回給定著色器階段 stage 的編譯錯誤訊息。等價於取得 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) 🔗
設定給定著色器階段 stage 的 SPIR-V 位元組碼 bytecode。等價於設定 bytecode_compute、bytecode_fragment、bytecode_tesselation_control、bytecode_tesselation_evaluation、bytecode_vertex 的其中之一。
void set_stage_compile_error(stage: ShaderStage, compile_error: String) 🔗
將指定著色器階段 stage 的編譯錯誤訊息設為 compile_error。等價於設定 compile_error_compute、compile_error_fragment、compile_error_tesselation_control、compile_error_tesselation_evaluation、compile_error_vertex 的其中之一。