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 中间表示,是 RDShaderFile 的一部分(由 RenderingDevice 使用)。

描述

RDShaderSPIRV 代表 RDShaderFile 不同着色器阶段的 SPIR-V 代码,以及可能的编译错误消息。SPIR-V 是一种低阶着色器中间表示。这种中间表示无法直接用于 GPU 渲染,但可以被编译为 GPU 能够理解的二进制着色器。与编译后的着色器不同,SPIR-V 可以在不同 GPU 型号以及驱动版本之间移植。

这个对象由 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() 🔗

任意命中着色器阶段的 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() 🔗

最近命中着色器阶段的 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() 🔗

计算着色器阶段的 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() 🔗

相交着色器阶段的 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() 🔗

未命中着色器阶段的 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() 🔗

光线生成着色器阶段的 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() 🔗

曲面细分控制着色器阶段的 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 = "" 🔗

“任意命中”着色器阶段的编译错误信息(由 SPIR-V 编译器和 Godot 设定)。如果这里为空,则说明着色器编译成功。


String compile_error_closest_hit = "" 🔗

“最近命中”着色器阶段的编译错误信息(由 SPIR-V 编译器和 Godot 引擎提供)。如果此处为空,则说明着色器编译成功。


String compile_error_compute = "" 🔗

计算着色器阶段的编译错误信息(由 SPIR-V 编译器和 Godot 设置)。如果为空,则着色器成功编译。


String compile_error_fragment = "" 🔗

片段着色器阶段的编译错误信息(由 SPIR-V 编译器和 Godot 设置)。如果为空,则着色器成功编译。


String compile_error_intersection = "" 🔗

“相交”着色器阶段的编译错误信息(由 SPIR-V 编译器和 Godot 引擎提供)。如果此处为空,则说明着色器编译成功。


String compile_error_miss = "" 🔗

“未命中”着色器阶段的编译错误信息(由 SPIR-V 编译器和 Godot 引擎提供)。如果此处为空,则说明着色器编译成功。


String compile_error_raygen = "" 🔗

光线生成着色器阶段的编译错误信息(由 SPIR-V 编译器和 Godot 设置)。如果此处为空,则表示着色器编译成功。


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 的其中之一。