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_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_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_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_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_compute、compile_error_fragment、compile_error_tesselation_control、compile_error_tesselation_evaluation、compile_error_vertex 的其中之一。