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...
RDPipelineSpecializationConstant¶
继承: RefCounted < Object
管线特化常量(由 RenderingDevice 使用)。
描述¶
特化常量可以创建同一着色器的额外版本,但不会导致实际编译的着色器版本数增加。这样就能减少着色器的版本数、减少 if
分支,从而提升性能,但与此同时保持着色器能够在不同场合灵活运用。
这个对象由 RenderingDevice 使用。
属性¶
|
||
属性说明¶
int constant_id = 0
特化常量的标识符。这个值从 0
开始,给定着色器中每一个不同的特化常量都会将其递增。
Variant value