From 951fc52ac612bbf59ffe19f12b088f2e84fc17c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 11 Nov 2022 19:11:40 +0100 Subject: [PATCH] GL: document when multi- and XFB-draw() doesn't result in any draw call. --- src/Magnum/GL/AbstractShaderProgram.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Magnum/GL/AbstractShaderProgram.h b/src/Magnum/GL/AbstractShaderProgram.h index da3b3c953..177cb3385 100644 --- a/src/Magnum/GL/AbstractShaderProgram.h +++ b/src/Magnum/GL/AbstractShaderProgram.h @@ -937,11 +937,13 @@ class MAGNUM_GL_EXPORT AbstractShaderProgram: public AbstractObject { * @return Reference to self (for method chaining) * @m_since_latest * - * If @gl_extension{ARB,vertex_array_object} (part of OpenGL 3.0), - * OpenGL ES 3.0, WebGL 2.0, @gl_extension{OES,vertex_array_object} in - * OpenGL ES 2.0 or @webgl_extension{OES,vertex_array_object} in WebGL - * 1.0 is available, the associated vertex array object is bound - * instead of setting up the mesh from scratch. + * Expects that @p mesh is compatible with this shader and is fully set + * up. If @p counts is empty, no draw commands are issued. If + * @gl_extension{ARB,vertex_array_object} (part of OpenGL 3.0), OpenGL + * ES 3.0, WebGL 2.0, @gl_extension{OES,vertex_array_object} in OpenGL + * ES 2.0 or @webgl_extension{OES,vertex_array_object} in WebGL 1.0 is + * available, the associated vertex array object is bound instead of + * setting up the mesh from scratch. * * If @p counts, @p vertexOffsets and @p indexOffsets are contiguous * views, they get passed directly to the underlying GL functions, @@ -1268,7 +1270,8 @@ class MAGNUM_GL_EXPORT AbstractShaderProgram: public AbstractObject { * * Expects that @p mesh is compatible with this shader, is fully set up * and that the output buffer(s) from @p xfb are used as vertex buffers - * in the mesh. Everything set by @ref Mesh::setCount(), + * in the mesh. If its instance count is @cpp 0 @ce, no draw commands + * are issued. Everything set by @ref Mesh::setCount(), * @ref Mesh::setBaseInstance(), @ref Mesh::setBaseVertex() and * @ref Mesh::setIndexBuffer() is ignored, the mesh is drawn as * non-indexed and the vertex count is taken from the @p xfb object. If