123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/RDPipelineSpecializationConstant.xml.
- .. _class_RDPipelineSpecializationConstant:
- RDPipelineSpecializationConstant
- ================================
- **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Pipeline specialization constant (used by :ref:`RenderingDevice<class_RenderingDevice>`).
- .. rst-class:: classref-introduction-group
- Description
- -----------
- A *specialization constant* is a way to create additional variants of shaders without actually increasing the number of shader versions that are compiled. This allows improving performance by reducing the number of shader versions and reducing ``if`` branching, while still allowing shaders to be flexible for different use cases.
- This object is used by :ref:`RenderingDevice<class_RenderingDevice>`.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------------+---------------------------------------------------------------------------------+-------+
- | :ref:`int<class_int>` | :ref:`constant_id<class_RDPipelineSpecializationConstant_property_constant_id>` | ``0`` |
- +-------------------------------+---------------------------------------------------------------------------------+-------+
- | :ref:`Variant<class_Variant>` | :ref:`value<class_RDPipelineSpecializationConstant_property_value>` | |
- +-------------------------------+---------------------------------------------------------------------------------+-------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_RDPipelineSpecializationConstant_property_constant_id:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **constant_id** = ``0`` :ref:`🔗<class_RDPipelineSpecializationConstant_property_constant_id>`
- .. rst-class:: classref-property-setget
- - |void| **set_constant_id**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_int>` **get_constant_id**\ (\ )
- The identifier of the specialization constant. This is a value starting from ``0`` and that increments for every different specialization constant for a given shader.
- .. rst-class:: classref-item-separator
- ----
- .. _class_RDPipelineSpecializationConstant_property_value:
- .. rst-class:: classref-property
- :ref:`Variant<class_Variant>` **value** :ref:`🔗<class_RDPipelineSpecializationConstant_property_value>`
- .. rst-class:: classref-property-setget
- - |void| **set_value**\ (\ value\: :ref:`Variant<class_Variant>`\ )
- - :ref:`Variant<class_Variant>` **get_value**\ (\ )
- The specialization constant's value. Only :ref:`bool<class_bool>`, :ref:`int<class_int>` and :ref:`float<class_float>` types are valid for specialization constants.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|