class_rdshaderspirv.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/RDShaderSPIRV.xml.
  6. .. _class_RDShaderSPIRV:
  7. RDShaderSPIRV
  8. =============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. SPIR-V intermediate representation as part of a :ref:`RDShaderFile<class_RDShaderFile>` (used by :ref:`RenderingDevice<class_RenderingDevice>`).
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **RDShaderSPIRV** represents a :ref:`RDShaderFile<class_RDShaderFile>`'s `SPIR-V <https://www.khronos.org/spir/>`__ code for various shader stages, as well as possible compilation error messages. SPIR-V is a low-level intermediate shader representation. This intermediate representation is not used directly by GPUs for rendering, but it can be compiled into binary shaders that GPUs can understand. Unlike compiled shaders, SPIR-V is portable across GPU models and driver versions.
  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:`PackedByteArray<class_PackedByteArray>` | :ref:`bytecode_compute<class_RDShaderSPIRV_property_bytecode_compute>` | ``PackedByteArray()`` |
  23. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  24. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`bytecode_fragment<class_RDShaderSPIRV_property_bytecode_fragment>` | ``PackedByteArray()`` |
  25. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  26. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`bytecode_tesselation_control<class_RDShaderSPIRV_property_bytecode_tesselation_control>` | ``PackedByteArray()`` |
  27. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  28. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`bytecode_tesselation_evaluation<class_RDShaderSPIRV_property_bytecode_tesselation_evaluation>` | ``PackedByteArray()`` |
  29. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  30. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`bytecode_vertex<class_RDShaderSPIRV_property_bytecode_vertex>` | ``PackedByteArray()`` |
  31. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  32. | :ref:`String<class_String>` | :ref:`compile_error_compute<class_RDShaderSPIRV_property_compile_error_compute>` | ``""`` |
  33. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  34. | :ref:`String<class_String>` | :ref:`compile_error_fragment<class_RDShaderSPIRV_property_compile_error_fragment>` | ``""`` |
  35. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  36. | :ref:`String<class_String>` | :ref:`compile_error_tesselation_control<class_RDShaderSPIRV_property_compile_error_tesselation_control>` | ``""`` |
  37. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  38. | :ref:`String<class_String>` | :ref:`compile_error_tesselation_evaluation<class_RDShaderSPIRV_property_compile_error_tesselation_evaluation>` | ``""`` |
  39. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  40. | :ref:`String<class_String>` | :ref:`compile_error_vertex<class_RDShaderSPIRV_property_compile_error_vertex>` | ``""`` |
  41. +-----------------------------------------------+----------------------------------------------------------------------------------------------------------------+-----------------------+
  42. .. rst-class:: classref-reftable-group
  43. Methods
  44. -------
  45. .. table::
  46. :widths: auto
  47. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`get_stage_bytecode<class_RDShaderSPIRV_method_get_stage_bytecode>` **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const| |
  49. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`String<class_String>` | :ref:`get_stage_compile_error<class_RDShaderSPIRV_method_get_stage_compile_error>` **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const| |
  51. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`set_stage_bytecode<class_RDShaderSPIRV_method_set_stage_bytecode>` **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`PackedByteArray<class_PackedByteArray>` bytecode **)** |
  53. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | void | :ref:`set_stage_compile_error<class_RDShaderSPIRV_method_set_stage_compile_error>` **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`String<class_String>` compile_error **)** |
  55. +-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. .. rst-class:: classref-section-separator
  57. ----
  58. .. rst-class:: classref-descriptions-group
  59. Property Descriptions
  60. ---------------------
  61. .. _class_RDShaderSPIRV_property_bytecode_compute:
  62. .. rst-class:: classref-property
  63. :ref:`PackedByteArray<class_PackedByteArray>` **bytecode_compute** = ``PackedByteArray()``
  64. .. rst-class:: classref-property-setget
  65. - void **set_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`PackedByteArray<class_PackedByteArray>` bytecode **)**
  66. - :ref:`PackedByteArray<class_PackedByteArray>` **get_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  67. The SPIR-V bytecode for the compute shader stage.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_RDShaderSPIRV_property_bytecode_fragment:
  71. .. rst-class:: classref-property
  72. :ref:`PackedByteArray<class_PackedByteArray>` **bytecode_fragment** = ``PackedByteArray()``
  73. .. rst-class:: classref-property-setget
  74. - void **set_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`PackedByteArray<class_PackedByteArray>` bytecode **)**
  75. - :ref:`PackedByteArray<class_PackedByteArray>` **get_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  76. The SPIR-V bytecode for the fragment shader stage.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_RDShaderSPIRV_property_bytecode_tesselation_control:
  80. .. rst-class:: classref-property
  81. :ref:`PackedByteArray<class_PackedByteArray>` **bytecode_tesselation_control** = ``PackedByteArray()``
  82. .. rst-class:: classref-property-setget
  83. - void **set_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`PackedByteArray<class_PackedByteArray>` bytecode **)**
  84. - :ref:`PackedByteArray<class_PackedByteArray>` **get_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  85. The SPIR-V bytecode for the tessellation control shader stage.
  86. .. rst-class:: classref-item-separator
  87. ----
  88. .. _class_RDShaderSPIRV_property_bytecode_tesselation_evaluation:
  89. .. rst-class:: classref-property
  90. :ref:`PackedByteArray<class_PackedByteArray>` **bytecode_tesselation_evaluation** = ``PackedByteArray()``
  91. .. rst-class:: classref-property-setget
  92. - void **set_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`PackedByteArray<class_PackedByteArray>` bytecode **)**
  93. - :ref:`PackedByteArray<class_PackedByteArray>` **get_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  94. The SPIR-V bytecode for the tessellation evaluation shader stage.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_RDShaderSPIRV_property_bytecode_vertex:
  98. .. rst-class:: classref-property
  99. :ref:`PackedByteArray<class_PackedByteArray>` **bytecode_vertex** = ``PackedByteArray()``
  100. .. rst-class:: classref-property-setget
  101. - void **set_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`PackedByteArray<class_PackedByteArray>` bytecode **)**
  102. - :ref:`PackedByteArray<class_PackedByteArray>` **get_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  103. The SPIR-V bytecode for the vertex shader stage.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_RDShaderSPIRV_property_compile_error_compute:
  107. .. rst-class:: classref-property
  108. :ref:`String<class_String>` **compile_error_compute** = ``""``
  109. .. rst-class:: classref-property-setget
  110. - void **set_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`String<class_String>` compile_error **)**
  111. - :ref:`String<class_String>` **get_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  112. The compilation error message for the compute shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_RDShaderSPIRV_property_compile_error_fragment:
  116. .. rst-class:: classref-property
  117. :ref:`String<class_String>` **compile_error_fragment** = ``""``
  118. .. rst-class:: classref-property-setget
  119. - void **set_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`String<class_String>` compile_error **)**
  120. - :ref:`String<class_String>` **get_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  121. The compilation error message for the fragment shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
  122. .. rst-class:: classref-item-separator
  123. ----
  124. .. _class_RDShaderSPIRV_property_compile_error_tesselation_control:
  125. .. rst-class:: classref-property
  126. :ref:`String<class_String>` **compile_error_tesselation_control** = ``""``
  127. .. rst-class:: classref-property-setget
  128. - void **set_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`String<class_String>` compile_error **)**
  129. - :ref:`String<class_String>` **get_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  130. The compilation error message for the tessellation control shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _class_RDShaderSPIRV_property_compile_error_tesselation_evaluation:
  134. .. rst-class:: classref-property
  135. :ref:`String<class_String>` **compile_error_tesselation_evaluation** = ``""``
  136. .. rst-class:: classref-property-setget
  137. - void **set_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`String<class_String>` compile_error **)**
  138. - :ref:`String<class_String>` **get_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  139. The compilation error message for the tessellation evaluation shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
  140. .. rst-class:: classref-item-separator
  141. ----
  142. .. _class_RDShaderSPIRV_property_compile_error_vertex:
  143. .. rst-class:: classref-property
  144. :ref:`String<class_String>` **compile_error_vertex** = ``""``
  145. .. rst-class:: classref-property-setget
  146. - void **set_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`String<class_String>` compile_error **)**
  147. - :ref:`String<class_String>` **get_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  148. The compilation error message for the vertex shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful.
  149. .. rst-class:: classref-section-separator
  150. ----
  151. .. rst-class:: classref-descriptions-group
  152. Method Descriptions
  153. -------------------
  154. .. _class_RDShaderSPIRV_method_get_stage_bytecode:
  155. .. rst-class:: classref-method
  156. :ref:`PackedByteArray<class_PackedByteArray>` **get_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  157. Equivalent to getting one of :ref:`bytecode_compute<class_RDShaderSPIRV_property_bytecode_compute>`, :ref:`bytecode_fragment<class_RDShaderSPIRV_property_bytecode_fragment>`, :ref:`bytecode_tesselation_control<class_RDShaderSPIRV_property_bytecode_tesselation_control>`, :ref:`bytecode_tesselation_evaluation<class_RDShaderSPIRV_property_bytecode_tesselation_evaluation>`, :ref:`bytecode_vertex<class_RDShaderSPIRV_property_bytecode_vertex>`.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_RDShaderSPIRV_method_get_stage_compile_error:
  161. .. rst-class:: classref-method
  162. :ref:`String<class_String>` **get_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage **)** |const|
  163. Returns the compilation error message for the given shader ``stage``. Equivalent to getting one of :ref:`compile_error_compute<class_RDShaderSPIRV_property_compile_error_compute>`, :ref:`compile_error_fragment<class_RDShaderSPIRV_property_compile_error_fragment>`, :ref:`compile_error_tesselation_control<class_RDShaderSPIRV_property_compile_error_tesselation_control>`, :ref:`compile_error_tesselation_evaluation<class_RDShaderSPIRV_property_compile_error_tesselation_evaluation>`, :ref:`compile_error_vertex<class_RDShaderSPIRV_property_compile_error_vertex>`.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_RDShaderSPIRV_method_set_stage_bytecode:
  167. .. rst-class:: classref-method
  168. void **set_stage_bytecode** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`PackedByteArray<class_PackedByteArray>` bytecode **)**
  169. Sets the SPIR-V ``bytecode`` for the given shader ``stage``. Equivalent to setting one of :ref:`bytecode_compute<class_RDShaderSPIRV_property_bytecode_compute>`, :ref:`bytecode_fragment<class_RDShaderSPIRV_property_bytecode_fragment>`, :ref:`bytecode_tesselation_control<class_RDShaderSPIRV_property_bytecode_tesselation_control>`, :ref:`bytecode_tesselation_evaluation<class_RDShaderSPIRV_property_bytecode_tesselation_evaluation>`, :ref:`bytecode_vertex<class_RDShaderSPIRV_property_bytecode_vertex>`.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_RDShaderSPIRV_method_set_stage_compile_error:
  173. .. rst-class:: classref-method
  174. void **set_stage_compile_error** **(** :ref:`ShaderStage<enum_RenderingDevice_ShaderStage>` stage, :ref:`String<class_String>` compile_error **)**
  175. Sets the compilation error message for the given shader ``stage`` to ``compile_error``. Equivalent to setting one of :ref:`compile_error_compute<class_RDShaderSPIRV_property_compile_error_compute>`, :ref:`compile_error_fragment<class_RDShaderSPIRV_property_compile_error_fragment>`, :ref:`compile_error_tesselation_control<class_RDShaderSPIRV_property_compile_error_tesselation_control>`, :ref:`compile_error_tesselation_evaluation<class_RDShaderSPIRV_property_compile_error_tesselation_evaluation>`, :ref:`compile_error_vertex<class_RDShaderSPIRV_property_compile_error_vertex>`.
  176. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  177. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  178. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  179. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  180. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  181. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  182. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`