Skip to content

Commit 920cfce

Browse files
committed
Document textureSize() should be avoided in Built-in functions
For performance reasons, it's best to pass the texture size as a uniform instead.
1 parent 4bb75ac commit 920cfce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tutorials/shaders/shader_reference/shader_functions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,9 +2254,9 @@ Texture functions
22542254
+------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------+
22552255
| | ivec2 | | :ref:`textureSize<shader_func_textureSize>`\ (\ |gsampler2D| s, int lod) | Get the size of a texture. |
22562256
| | ivec2 | | :ref:`textureSize<shader_func_textureSize>`\ (\ samplerCube s, int lod) | |
2257-
| | ivec2 | | :ref:`textureSize<shader_func_textureSize>`\ (\ samplerCubeArray s, int lod) | |
2258-
| | ivec3 | | :ref:`textureSize<shader_func_textureSize>`\ (\ |gsampler2DArray| s, int lod) | |
2259-
| | ivec3 | | :ref:`textureSize<shader_func_textureSize>`\ (\ |gsampler3D| s, int lod) | |
2257+
| | ivec2 | | :ref:`textureSize<shader_func_textureSize>`\ (\ samplerCubeArray s, int lod) | For performance reasons, this function should be avoided as it |
2258+
| | ivec3 | | :ref:`textureSize<shader_func_textureSize>`\ (\ |gsampler2DArray| s, int lod) | always performs a full texture read. When possible, you should pass |
2259+
| | ivec3 | | :ref:`textureSize<shader_func_textureSize>`\ (\ |gsampler3D| s, int lod) | the texture size as a uniform instead. |
22602260
+------------------+---------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------+
22612261
| | vec2 | | :ref:`textureQueryLod<shader_func_textureQueryLod>`\ (\ |gsampler2D| s, vec2 p) | Compute the level-of-detail that would be used to sample from a |
22622262
| | vec3 | | :ref:`textureQueryLod<shader_func_textureQueryLod>`\ (\ |gsampler2DArray| s, vec2 p) | texture. |

0 commit comments

Comments
 (0)