diff --git a/doc/shaders.dox b/doc/shaders.dox index ba45fe20c..615420471 100644 --- a/doc/shaders.dox +++ b/doc/shaders.dox @@ -198,7 +198,9 @@ like this, uniform upload and binding is the same as before: and deduplicated among several buffers is to maximize use of that memory. With that you should always be able to submit at least 256 draws at once as the biggest per-draw uniform structure used by builtin shaders has a size - of a 4x4 matrix. + of a 4x4 matrix. See documentation of + @ref Shaders::FlatGL::Configuration::setDrawCount() "Shaders::*::Configuration::setDrawCount()" + and related APIs of a particular shader for concrete limits. @par For larger batches the expected workflow is to still upload everything at once but then bind and draw smaller (and properly aligned) subranges that diff --git a/src/Magnum/Shaders/DistanceFieldVectorGL.h b/src/Magnum/Shaders/DistanceFieldVectorGL.h index 24e466454..9d91fa55c 100644 --- a/src/Magnum/Shaders/DistanceFieldVectorGL.h +++ b/src/Magnum/Shaders/DistanceFieldVectorGL.h @@ -673,10 +673,13 @@ template class DistanceFieldVectorGL::Config * * If @ref Flag::UniformBuffers is set, describes size of a * @ref DistanceFieldVectorMaterialUniform buffer bound with - * @ref bindMaterialBuffer(); as uniform buffers are required to have a - * statically defined size. The per-draw materials are then specified - * via @ref DistanceFieldVectorDrawUniform::materialId. Default value - * is @cpp 1 @ce. + * @ref bindMaterialBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(DistanceFieldVectorMaterialUniform) @ce + * has to be within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-draw materials are then specified via + * @ref DistanceFieldVectorDrawUniform::materialId. Default value is + * @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setDrawCount(), @@ -685,8 +688,8 @@ template class DistanceFieldVectorGL::Config * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setMaterialCount(UnsignedInt materialCount) { - _materialCount = materialCount; + Configuration& setMaterialCount(UnsignedInt count) { + _materialCount = count; return *this; } @@ -707,9 +710,16 @@ template class DistanceFieldVectorGL::Config * @ref DistanceFieldVectorDrawUniform / * @ref TextureTransformationUniform buffer bound with * @ref bindTransformationProjectionBuffer(), @ref bindDrawBuffer() and - * @ref bindTextureTransformationBuffer(); as uniform buffers are - * required to have a statically defined size. The draw offset is then - * set via @ref setDrawOffset(). Default value is @cpp 1 @ce. + * @ref bindTextureTransformationBuffer(). Uniform buffers have a + * statically defined size and the maximum of + * @cpp count*sizeof(TransformationProjectionUniform2D) @ce / + * @cpp count*sizeof(TransformationProjectionUniform3D) @ce, + * @cpp count*sizeof(DistanceFieldVectorDrawUniform) @ce and + * @cpp count*sizeof(TextureTransformationUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The draw offset is then set via @ref setDrawOffset(). Default value + * is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setMaterialCount(), @@ -718,8 +728,8 @@ template class DistanceFieldVectorGL::Config * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setDrawCount(UnsignedInt drawCount) { - _drawCount = drawCount; + Configuration& setDrawCount(UnsignedInt count) { + _drawCount = count; return *this; } #endif diff --git a/src/Magnum/Shaders/FlatGL.h b/src/Magnum/Shaders/FlatGL.h index 63e28c5b6..106465c03 100644 --- a/src/Magnum/Shaders/FlatGL.h +++ b/src/Magnum/Shaders/FlatGL.h @@ -1409,10 +1409,14 @@ template class MAGNUM_SHADERS_EXPORT FlatGL: * @ref setJointMatrices() / @ref setJointMatrix(). If * @ref Flag::UniformBuffers is set, @p count describes size of a * @ref TransformationUniform2D / @ref TransformationUniform3D buffer - * bound with @ref bindJointBuffer(); as uniform buffers are required - * to have a statically defined size. The per-vertex joints then index - * into the array offset by @ref FlatDrawUniform::jointOffset. If - * @p count is @cpp 0 @ce, skinning is not performed. + * bound with @ref bindJointBuffer(). Uniform buffers have a statically + * defined size and @cpp count*sizeof(TransformationUniform2D) @ce / + * @cpp count*sizeof(TransformationUniform3D) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-vertex joints then index into the array offset by + * @ref FlatDrawUniform::jointOffset. If @p count is @cpp 0 @ce, + * skinning is not performed. * * The @p perVertexCount and @p secondaryPerVertexCount then describe * how many components are taken from @ref JointIds / @ref Weights and @@ -1450,9 +1454,12 @@ template class MAGNUM_SHADERS_EXPORT FlatGL: * * If @ref Flag::UniformBuffers is set, describes size of a * @ref FlatMaterialUniform buffer bound with - * @ref bindMaterialBuffer(); as uniform buffers are required to have a - * statically defined size. The per-draw materials are then specified - * via @ref FlatDrawUniform::materialId. Default value is @cpp 1 @ce. + * @ref bindMaterialBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(FlatMaterialUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-draw materials are then specified via + * @ref FlatDrawUniform::materialId. Default value is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setDrawCount(), @@ -1461,8 +1468,8 @@ template class MAGNUM_SHADERS_EXPORT FlatGL: * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setMaterialCount(UnsignedInt materialCount) { - _materialCount = materialCount; + Configuration& setMaterialCount(UnsignedInt count) { + _materialCount = count; return *this; } @@ -1482,10 +1489,16 @@ template class MAGNUM_SHADERS_EXPORT FlatGL: * @ref TransformationProjectionUniform3D / * @ref FlatDrawUniform / @ref TextureTransformationUniform buffer * bound with @ref bindTransformationProjectionBuffer(), - * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(); as - * uniform buffers are required to have a statically defined size. The - * draw offset is then set via @ref setDrawOffset(). Default value is - * @cpp 1 @ce. + * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(). + * Uniform buffers have a statically defined size and the maximum of + * @cpp count*sizeof(TransformationProjectionUniform2D) @ce / + * @cpp count*sizeof(TransformationProjectionUniform3D) @ce, + * @cpp count*sizeof(FlatDrawUniform) @ce and + * @cpp count*sizeof(TextureTransformationUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The draw offset is then set via @ref setDrawOffset(). Default value + * is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setMaterialCount(), @@ -1494,8 +1507,8 @@ template class MAGNUM_SHADERS_EXPORT FlatGL: * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setDrawCount(UnsignedInt drawCount) { - _drawCount = drawCount; + Configuration& setDrawCount(UnsignedInt count) { + _drawCount = count; return *this; } #endif diff --git a/src/Magnum/Shaders/MeshVisualizerGL.h b/src/Magnum/Shaders/MeshVisualizerGL.h index cafc87ed3..af75115b1 100644 --- a/src/Magnum/Shaders/MeshVisualizerGL.h +++ b/src/Magnum/Shaders/MeshVisualizerGL.h @@ -1209,8 +1209,11 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D::Configuration { * bound on how many joint matrices get supplied to each draw with * @ref setJointMatrices() / @ref setJointMatrix(). If * @ref Flag::UniformBuffers is set, @p count describes size of a - * @ref TransformationUniform2D buffer bound with @ref bindJointBuffer(); - * as uniform buffers are required to have a statically defined size. + * @ref TransformationUniform2D buffer bound with + * @ref bindJointBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(TransformationUniform2D) @ce has to be + * within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * * The per-vertex joints then index into the array offset by * @ref MeshVisualizerDrawUniform2D::jointOffset. If @p count is * @cpp 0 @ce, skinning is not performed. @@ -1252,9 +1255,12 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D::Configuration { * * If @ref Flag::UniformBuffers is set, describes size of a * @ref MeshVisualizerMaterialUniform buffer bound with - * @ref bindMaterialBuffer(); as uniform buffers are required to have a - * statically defined size. The per-draw materials are then specified - * via @ref MeshVisualizerDrawUniform2D::materialId. Default value is + * @ref bindMaterialBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(MeshVisualizerMaterialUniform) @ce has to + * be within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-draw materials are then specified via + * @ref MeshVisualizerDrawUniform2D::materialId. Default value is * @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. @@ -1264,8 +1270,8 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setMaterialCount(UnsignedInt materialCount) { - _materialCount = materialCount; + Configuration& setMaterialCount(UnsignedInt count) { + _materialCount = count; return *this; } @@ -1284,10 +1290,15 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D::Configuration { * @ref TransformationProjectionUniform2D / * @ref MeshVisualizerDrawUniform2D / @ref TextureTransformationUniform * buffer bound with @ref bindTransformationProjectionBuffer(), - * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(); as - * uniform buffers are required to have a statically defined size. The - * draw offset is then set via @ref setDrawOffset(). Default value is - * @cpp 1 @ce. + * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(). + * Uniform buffers have a statically defined size and the maximum of + * @cpp count*sizeof(TransformationProjectionUniform2D) @ce, + * @cpp count*sizeof(MeshVisualizerDrawUniform2D) @ce and + * @cpp count*sizeof(TextureTransformationUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The draw offset is then set via @ref setDrawOffset(). Default value + * is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setMaterialCount(), @@ -1296,8 +1307,8 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setDrawCount(UnsignedInt drawCount) { - _drawCount = drawCount; + Configuration& setDrawCount(UnsignedInt count) { + _drawCount = count; return *this; } #endif @@ -3191,8 +3202,11 @@ class MeshVisualizerGL3D::Configuration { * bound on how many joint matrices get supplied to each draw with * @ref setJointMatrices() / @ref setJointMatrix(). If * @ref Flag::UniformBuffers is set, @p count describes size of a - * @ref TransformationUniform3D buffer bound with @ref bindJointBuffer(); - * as uniform buffers are required to have a statically defined size. + * @ref TransformationUniform3D buffer bound with + * @ref bindJointBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(TransformationUniform3D) @ce has to be + * within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * * The per-vertex joints then index into the array offset by * @ref MeshVisualizerDrawUniform3D::jointOffset. If @p count is * @cpp 0 @ce, skinning is not performed. @@ -3234,9 +3248,12 @@ class MeshVisualizerGL3D::Configuration { * * If @ref Flag::UniformBuffers is set, describes size of a * @ref MeshVisualizerMaterialUniform buffer bound with - * @ref bindMaterialBuffer(); as uniform buffers are required to have a - * statically defined size. The per-draw materials are then specified - * via @ref MeshVisualizerDrawUniform3D::materialId. Default value is + * @ref bindMaterialBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(MeshVisualizerMaterialUniform) @ce has to + * be within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-draw materials are then specified via + * @ref MeshVisualizerDrawUniform3D::materialId. Default value is * @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. @@ -3246,8 +3263,8 @@ class MeshVisualizerGL3D::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setMaterialCount(UnsignedInt materialCount) { - _materialCount = materialCount; + Configuration& setMaterialCount(UnsignedInt count) { + _materialCount = count; return *this; } @@ -3266,9 +3283,15 @@ class MeshVisualizerGL3D::Configuration { * @ref TransformationUniform3D / @ref MeshVisualizerDrawUniform3D / * @ref TextureTransformationUniform buffer bound with * @ref bindTransformationBuffer(), @ref bindDrawBuffer() and - * @ref bindTextureTransformationBuffer(); as uniform buffers are - * required to have a statically defined size. The draw offset is then - * set via @ref setDrawOffset(). Default value is @cpp 1 @ce. + * @ref bindTextureTransformationBuffer(). Uniform buffers have a + * statically defined size and the maximum of + * @cpp count*sizeof(TransformationUniform3D) @ce, + * @cpp count*sizeof(MeshVisualizerDrawUniform3D) @ce and + * @cpp count*sizeof(TextureTransformationUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The draw offset is then set via @ref setDrawOffset(). Default value + * is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setMaterialCount(), @@ -3277,8 +3300,8 @@ class MeshVisualizerGL3D::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setDrawCount(UnsignedInt drawCount) { - _drawCount = drawCount; + Configuration& setDrawCount(UnsignedInt count) { + _drawCount = count; return *this; } #endif diff --git a/src/Magnum/Shaders/PhongGL.h b/src/Magnum/Shaders/PhongGL.h index 2cf90d817..0bf006ce8 100644 --- a/src/Magnum/Shaders/PhongGL.h +++ b/src/Magnum/Shaders/PhongGL.h @@ -2144,12 +2144,14 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration { * accepted by @ref setLightPosition() / @ref setLightPositions(), * @ref setLightColor() / @ref setLightColors(), * @ref setLightSpecularColor() / @ref setLightSpecularColors() and - * @ref setLightRange() / @ref setLightRanges(). - * - * If @ref Flag::UniformBuffers is set, describes size of a - * @ref PhongLightUniform buffer bound with @ref bindLightBuffer(); as - * uniform buffers are required to have a statically defined size. The - * per-draw lights are then specified via + * @ref setLightRange() / @ref setLightRanges(). If + * @ref Flag::UniformBuffers is set, describes size of a + * @ref PhongLightUniform buffer bound with @ref bindLightBuffer(). + * Uniform buffers have a statically defined size and + * @cpp count*sizeof(PhongLightUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-draw lights are then specified via * @ref PhongDrawUniform::lightOffset and * @ref PhongDrawUniform::lightCount. * @@ -2195,8 +2197,11 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration { * bound on how many joint matrices get supplied to each draw with * @ref setJointMatrices() / @ref setJointMatrix(). If * @ref Flag::UniformBuffers is set, @p count describes size of a - * @ref TransformationUniform3D buffer bound with @ref bindJointBuffer(); - * as uniform buffers are required to have a statically defined size. + * @ref TransformationUniform3D buffer bound with + * @ref bindJointBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(TransformationUniform3D) @ce has to be + * within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * * The per-vertex joints then index into the array offset by * @ref PhongDrawUniform::jointOffset. If @p count is @cpp 0 @ce, * skinning is not performed. @@ -2237,9 +2242,12 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration { * * If @ref Flag::UniformBuffers is set, describes size of a * @ref PhongMaterialUniform buffer bound with - * @ref bindMaterialBuffer(); as uniform buffers are required to have a - * statically defined size. The per-draw materials are then specified - * via @ref PhongDrawUniform::materialId. Default value is @cpp 1 @ce. + * @ref bindMaterialBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(PhongMaterialUniform) @ce has to be + * within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-draw materials are then specified via + * @ref PhongDrawUniform::materialId. Default value is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setLightCount(), @ref setDrawCount(), @@ -2248,8 +2256,8 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setMaterialCount(UnsignedInt materialCount) { - _materialCount = materialCount; + Configuration& setMaterialCount(UnsignedInt count) { + _materialCount = count; return *this; } @@ -2268,9 +2276,15 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration { * @ref TransformationUniform3D / @ref PhongDrawUniform / * @ref TextureTransformationUniform buffer bound with * @ref bindTransformationBuffer(), @ref bindDrawBuffer() and - * @ref bindTextureTransformationBuffer(); as uniform buffers are - * required to have a statically defined size. The draw offset is then - * set via @ref setDrawOffset(). Default value is @cpp 1 @ce. + * @ref bindTextureTransformationBuffer(). Uniform buffers have a + * statically defined size and the maximum of + * @cpp count*sizeof(TransformationUniform3D) @ce, + * @cpp count*sizeof(PhongDrawUniform) @ce and + * @cpp count*sizeof(TextureTransformationUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The draw offset is then set via @ref setDrawOffset(). Default value + * is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setLightCount(), @ref setMaterialCount(), @@ -2279,8 +2293,8 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setDrawCount(UnsignedInt drawCount) { - _drawCount = drawCount; + Configuration& setDrawCount(UnsignedInt count) { + _drawCount = count; return *this; } #endif diff --git a/src/Magnum/Shaders/VectorGL.h b/src/Magnum/Shaders/VectorGL.h index 0d6b68dd3..eb299c62a 100644 --- a/src/Magnum/Shaders/VectorGL.h +++ b/src/Magnum/Shaders/VectorGL.h @@ -624,9 +624,12 @@ template class VectorGL::Configuration { * * If @ref Flag::UniformBuffers is set, describes size of a * @ref VectorMaterialUniform buffer bound with - * @ref bindMaterialBuffer(); as uniform buffers are required to have a - * statically defined size. The per-draw materials are then specified - * via @ref VectorDrawUniform::materialId. Default value is @cpp 1 @ce. + * @ref bindMaterialBuffer(). Uniform buffers have a statically defined + * size and @cpp count*sizeof(VectorMaterialUniform) @ce has to be + * within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The per-draw materials are then specified via + * @ref VectorDrawUniform::materialId. Default value is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setDrawCount(), @@ -635,8 +638,8 @@ template class VectorGL::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setMaterialCount(UnsignedInt materialCount) { - _materialCount = materialCount; + Configuration& setMaterialCount(UnsignedInt count) { + _materialCount = count; return *this; } @@ -656,10 +659,16 @@ template class VectorGL::Configuration { * @ref TransformationProjectionUniform3D / * @ref VectorDrawUniform / @ref TextureTransformationUniform buffer * bound with @ref bindTransformationProjectionBuffer(), - * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(); as - * uniform buffers are required to have a statically defined size. The - * draw offset is then set via @ref setDrawOffset(). Default value is - * @cpp 1 @ce. + * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(). + * Uniform buffers have a statically defined size and the maximum of + * @cpp count*sizeof(TransformationProjectionUniform2D) @ce / + * @cpp count*sizeof(TransformationProjectionUniform3D) @ce, + * @cpp count*sizeof(VectorDrawUniform) @ce and + * @cpp count*sizeof(TextureTransformationUniform) @ce has to be within + * @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The draw offset is then set via @ref setDrawOffset(). Default value + * is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref setMaterialCount(), @@ -668,8 +677,8 @@ template class VectorGL::Configuration { * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setDrawCount(UnsignedInt drawCount) { - _drawCount = drawCount; + Configuration& setDrawCount(UnsignedInt count) { + _drawCount = count; return *this; } #endif diff --git a/src/Magnum/Shaders/VertexColorGL.h b/src/Magnum/Shaders/VertexColorGL.h index 3eccb2371..ae89000d7 100644 --- a/src/Magnum/Shaders/VertexColorGL.h +++ b/src/Magnum/Shaders/VertexColorGL.h @@ -476,9 +476,14 @@ template class VertexColorGL::Configuration * If @ref Flag::UniformBuffers is set, describes size of a * @ref TransformationProjectionUniform2D / * @ref TransformationProjectionUniform3D buffer bound with - * @ref bindTransformationProjectionBuffer(); as uniform buffers are - * required to have a statically defined size. The draw offset is then - * set via @ref setDrawOffset(). Default value is @cpp 1 @ce. + * @ref bindTransformationProjectionBuffer(). Uniform buffers have a + * statically defined size and + * @cpp count*sizeof(TransformationProjectionUniform2D) @ce /, + * @cpp count*sizeof(TransformationProjectionUniform3D) @ce has to be + * within @ref GL::AbstractShaderProgram::maxUniformBlockSize(). + * + * The draw offset is then set via @ref setDrawOffset(). Default value + * is @cpp 1 @ce. * * If @ref Flag::UniformBuffers isn't set, this value is ignored. * @see @ref setFlags(), @ref VertexColorGL::drawCount() @@ -486,8 +491,8 @@ template class VertexColorGL::Configuration * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0. */ - Configuration& setDrawCount(UnsignedInt drawCount) { - _drawCount = drawCount; + Configuration& setDrawCount(UnsignedInt count) { + _drawCount = count; return *this; } #endif