Skip to content

Commit

Permalink
Add note about uniform buffer size limit to Shading Language
Browse files Browse the repository at this point in the history
  • Loading branch information
tetrapod00 committed Oct 27, 2024
1 parent 2164b06 commit b9b91cc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tutorials/shaders/shader_reference/shading_language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,15 @@ GDScript:
in the shader. It must match *exactly* to the name of the uniform in
the shader or else it will not be recognized.

.. note:: There is a limit to the total size of shader uniforms that you can use
in a single shader. On most desktop platforms, this limit is ``65536``
bytes, or ``4096`` ``vec4`` uniforms. On mobile platforms, the limit is smaller.
Uniforms smaller than a ``vec4``, such as ``float`` or ``vec2``, are
padded to the size of a ``vec4``. Arrays count as the total size of their
contents. If you need a uniform array that is larger than this limit,
consider packing the data into a texture instead, since the *contents*
of a texture do not count towards this limit, only the size of the
sampler uniform.

Uniform hints
~~~~~~~~~~~~~
Expand Down

0 comments on commit b9b91cc

Please sign in to comment.