class_rdpipelinespecializationconstant.rst 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/RDPipelineSpecializationConstant.xml.
  6. .. _class_RDPipelineSpecializationConstant:
  7. RDPipelineSpecializationConstant
  8. ================================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Pipeline specialization constant (used by :ref:`RenderingDevice<class_RenderingDevice>`).
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. This object is used by :ref:`RenderingDevice<class_RenderingDevice>`.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------+---------------------------------------------------------------------------------+-------+
  22. | :ref:`int<class_int>` | :ref:`constant_id<class_RDPipelineSpecializationConstant_property_constant_id>` | ``0`` |
  23. +-------------------------------+---------------------------------------------------------------------------------+-------+
  24. | :ref:`Variant<class_Variant>` | :ref:`value<class_RDPipelineSpecializationConstant_property_value>` | |
  25. +-------------------------------+---------------------------------------------------------------------------------+-------+
  26. .. rst-class:: classref-section-separator
  27. ----
  28. .. rst-class:: classref-descriptions-group
  29. Property Descriptions
  30. ---------------------
  31. .. _class_RDPipelineSpecializationConstant_property_constant_id:
  32. .. rst-class:: classref-property
  33. :ref:`int<class_int>` **constant_id** = ``0`` :ref:`🔗<class_RDPipelineSpecializationConstant_property_constant_id>`
  34. .. rst-class:: classref-property-setget
  35. - |void| **set_constant_id**\ (\ value\: :ref:`int<class_int>`\ )
  36. - :ref:`int<class_int>` **get_constant_id**\ (\ )
  37. 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.
  38. .. rst-class:: classref-item-separator
  39. ----
  40. .. _class_RDPipelineSpecializationConstant_property_value:
  41. .. rst-class:: classref-property
  42. :ref:`Variant<class_Variant>` **value** :ref:`🔗<class_RDPipelineSpecializationConstant_property_value>`
  43. .. rst-class:: classref-property-setget
  44. - |void| **set_value**\ (\ value\: :ref:`Variant<class_Variant>`\ )
  45. - :ref:`Variant<class_Variant>` **get_value**\ (\ )
  46. 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.
  47. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  48. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  49. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  50. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  51. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  52. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  53. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  54. .. |void| replace:: :abbr:`void (No return value.)`