Browse Source

Shaders: mention UBO limits in Configuration setters.

pull/601/head
Vladimír Vondruš 3 years ago
parent
commit
3701f8fa5c
  1. 4
      doc/shaders.dox
  2. 32
      src/Magnum/Shaders/DistanceFieldVectorGL.h
  3. 43
      src/Magnum/Shaders/FlatGL.h
  4. 73
      src/Magnum/Shaders/MeshVisualizerGL.h
  5. 50
      src/Magnum/Shaders/PhongGL.h
  6. 31
      src/Magnum/Shaders/VectorGL.h
  7. 15
      src/Magnum/Shaders/VertexColorGL.h

4
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. 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 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 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 @par
For larger batches the expected workflow is to still upload everything at For larger batches the expected workflow is to still upload everything at
once but then bind and draw smaller (and properly aligned) subranges that once but then bind and draw smaller (and properly aligned) subranges that

32
src/Magnum/Shaders/DistanceFieldVectorGL.h

@ -673,10 +673,13 @@ template<UnsignedInt dimensions> class DistanceFieldVectorGL<dimensions>::Config
* *
* If @ref Flag::UniformBuffers is set, describes size of a * If @ref Flag::UniformBuffers is set, describes size of a
* @ref DistanceFieldVectorMaterialUniform buffer bound with * @ref DistanceFieldVectorMaterialUniform buffer bound with
* @ref bindMaterialBuffer(); as uniform buffers are required to have a * @ref bindMaterialBuffer(). Uniform buffers have a statically defined
* statically defined size. The per-draw materials are then specified * size and @cpp count*sizeof(DistanceFieldVectorMaterialUniform) @ce
* via @ref DistanceFieldVectorDrawUniform::materialId. Default value * has to be within @ref GL::AbstractShaderProgram::maxUniformBlockSize().
* is @cpp 1 @ce. *
* 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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setDrawCount(), * @see @ref setFlags(), @ref setDrawCount(),
@ -685,8 +688,8 @@ template<UnsignedInt dimensions> class DistanceFieldVectorGL<dimensions>::Config
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setMaterialCount(UnsignedInt materialCount) { Configuration& setMaterialCount(UnsignedInt count) {
_materialCount = materialCount; _materialCount = count;
return *this; return *this;
} }
@ -707,9 +710,16 @@ template<UnsignedInt dimensions> class DistanceFieldVectorGL<dimensions>::Config
* @ref DistanceFieldVectorDrawUniform / * @ref DistanceFieldVectorDrawUniform /
* @ref TextureTransformationUniform buffer bound with * @ref TextureTransformationUniform buffer bound with
* @ref bindTransformationProjectionBuffer(), @ref bindDrawBuffer() and * @ref bindTransformationProjectionBuffer(), @ref bindDrawBuffer() and
* @ref bindTextureTransformationBuffer(); as uniform buffers are * @ref bindTextureTransformationBuffer(). Uniform buffers have a
* required to have a statically defined size. The draw offset is then * statically defined size and the maximum of
* set via @ref setDrawOffset(). Default value is @cpp 1 @ce. * @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setMaterialCount(), * @see @ref setFlags(), @ref setMaterialCount(),
@ -718,8 +728,8 @@ template<UnsignedInt dimensions> class DistanceFieldVectorGL<dimensions>::Config
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setDrawCount(UnsignedInt drawCount) { Configuration& setDrawCount(UnsignedInt count) {
_drawCount = drawCount; _drawCount = count;
return *this; return *this;
} }
#endif #endif

43
src/Magnum/Shaders/FlatGL.h

@ -1409,10 +1409,14 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL<dimensions>:
* @ref setJointMatrices() / @ref setJointMatrix(). If * @ref setJointMatrices() / @ref setJointMatrix(). If
* @ref Flag::UniformBuffers is set, @p count describes size of a * @ref Flag::UniformBuffers is set, @p count describes size of a
* @ref TransformationUniform2D / @ref TransformationUniform3D buffer * @ref TransformationUniform2D / @ref TransformationUniform3D buffer
* bound with @ref bindJointBuffer(); as uniform buffers are required * bound with @ref bindJointBuffer(). Uniform buffers have a statically
* to have a statically defined size. The per-vertex joints then index * defined size and @cpp count*sizeof(TransformationUniform2D) @ce /
* into the array offset by @ref FlatDrawUniform::jointOffset. If * @cpp count*sizeof(TransformationUniform3D) @ce has to be within
* @p count is @cpp 0 @ce, skinning is not performed. * @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 * The @p perVertexCount and @p secondaryPerVertexCount then describe
* how many components are taken from @ref JointIds / @ref Weights and * how many components are taken from @ref JointIds / @ref Weights and
@ -1450,9 +1454,12 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL<dimensions>:
* *
* If @ref Flag::UniformBuffers is set, describes size of a * If @ref Flag::UniformBuffers is set, describes size of a
* @ref FlatMaterialUniform buffer bound with * @ref FlatMaterialUniform buffer bound with
* @ref bindMaterialBuffer(); as uniform buffers are required to have a * @ref bindMaterialBuffer(). Uniform buffers have a statically defined
* statically defined size. The per-draw materials are then specified * size and @cpp count*sizeof(FlatMaterialUniform) @ce has to be within
* via @ref FlatDrawUniform::materialId. Default value is @cpp 1 @ce. * @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setDrawCount(), * @see @ref setFlags(), @ref setDrawCount(),
@ -1461,8 +1468,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL<dimensions>:
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setMaterialCount(UnsignedInt materialCount) { Configuration& setMaterialCount(UnsignedInt count) {
_materialCount = materialCount; _materialCount = count;
return *this; return *this;
} }
@ -1482,10 +1489,16 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL<dimensions>:
* @ref TransformationProjectionUniform3D / * @ref TransformationProjectionUniform3D /
* @ref FlatDrawUniform / @ref TextureTransformationUniform buffer * @ref FlatDrawUniform / @ref TextureTransformationUniform buffer
* bound with @ref bindTransformationProjectionBuffer(), * bound with @ref bindTransformationProjectionBuffer(),
* @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(); as * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer().
* uniform buffers are required to have a statically defined size. The * Uniform buffers have a statically defined size and the maximum of
* draw offset is then set via @ref setDrawOffset(). Default value is * @cpp count*sizeof(TransformationProjectionUniform2D) @ce /
* @cpp 1 @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setMaterialCount(), * @see @ref setFlags(), @ref setMaterialCount(),
@ -1494,8 +1507,8 @@ template<UnsignedInt dimensions> class MAGNUM_SHADERS_EXPORT FlatGL<dimensions>:
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setDrawCount(UnsignedInt drawCount) { Configuration& setDrawCount(UnsignedInt count) {
_drawCount = drawCount; _drawCount = count;
return *this; return *this;
} }
#endif #endif

73
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 * bound on how many joint matrices get supplied to each draw with
* @ref setJointMatrices() / @ref setJointMatrix(). If * @ref setJointMatrices() / @ref setJointMatrix(). If
* @ref Flag::UniformBuffers is set, @p count describes size of a * @ref Flag::UniformBuffers is set, @p count describes size of a
* @ref TransformationUniform2D buffer bound with @ref bindJointBuffer(); * @ref TransformationUniform2D buffer bound with
* as uniform buffers are required to have a statically defined size. * @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 * The per-vertex joints then index into the array offset by
* @ref MeshVisualizerDrawUniform2D::jointOffset. If @p count is * @ref MeshVisualizerDrawUniform2D::jointOffset. If @p count is
* @cpp 0 @ce, skinning is not performed. * @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 * If @ref Flag::UniformBuffers is set, describes size of a
* @ref MeshVisualizerMaterialUniform buffer bound with * @ref MeshVisualizerMaterialUniform buffer bound with
* @ref bindMaterialBuffer(); as uniform buffers are required to have a * @ref bindMaterialBuffer(). Uniform buffers have a statically defined
* statically defined size. The per-draw materials are then specified * size and @cpp count*sizeof(MeshVisualizerMaterialUniform) @ce has to
* via @ref MeshVisualizerDrawUniform2D::materialId. Default value is * be within @ref GL::AbstractShaderProgram::maxUniformBlockSize().
*
* The per-draw materials are then specified via
* @ref MeshVisualizerDrawUniform2D::materialId. Default value is
* @cpp 1 @ce. * @cpp 1 @ce.
* *
* If @ref Flag::UniformBuffers isn't set, this value is ignored. * 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_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setMaterialCount(UnsignedInt materialCount) { Configuration& setMaterialCount(UnsignedInt count) {
_materialCount = materialCount; _materialCount = count;
return *this; return *this;
} }
@ -1284,10 +1290,15 @@ class MAGNUM_SHADERS_EXPORT MeshVisualizerGL2D::Configuration {
* @ref TransformationProjectionUniform2D / * @ref TransformationProjectionUniform2D /
* @ref MeshVisualizerDrawUniform2D / @ref TextureTransformationUniform * @ref MeshVisualizerDrawUniform2D / @ref TextureTransformationUniform
* buffer bound with @ref bindTransformationProjectionBuffer(), * buffer bound with @ref bindTransformationProjectionBuffer(),
* @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(); as * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer().
* uniform buffers are required to have a statically defined size. The * Uniform buffers have a statically defined size and the maximum of
* draw offset is then set via @ref setDrawOffset(). Default value is * @cpp count*sizeof(TransformationProjectionUniform2D) @ce,
* @cpp 1 @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setMaterialCount(), * @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_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setDrawCount(UnsignedInt drawCount) { Configuration& setDrawCount(UnsignedInt count) {
_drawCount = drawCount; _drawCount = count;
return *this; return *this;
} }
#endif #endif
@ -3191,8 +3202,11 @@ class MeshVisualizerGL3D::Configuration {
* bound on how many joint matrices get supplied to each draw with * bound on how many joint matrices get supplied to each draw with
* @ref setJointMatrices() / @ref setJointMatrix(). If * @ref setJointMatrices() / @ref setJointMatrix(). If
* @ref Flag::UniformBuffers is set, @p count describes size of a * @ref Flag::UniformBuffers is set, @p count describes size of a
* @ref TransformationUniform3D buffer bound with @ref bindJointBuffer(); * @ref TransformationUniform3D buffer bound with
* as uniform buffers are required to have a statically defined size. * @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 * The per-vertex joints then index into the array offset by
* @ref MeshVisualizerDrawUniform3D::jointOffset. If @p count is * @ref MeshVisualizerDrawUniform3D::jointOffset. If @p count is
* @cpp 0 @ce, skinning is not performed. * @cpp 0 @ce, skinning is not performed.
@ -3234,9 +3248,12 @@ class MeshVisualizerGL3D::Configuration {
* *
* If @ref Flag::UniformBuffers is set, describes size of a * If @ref Flag::UniformBuffers is set, describes size of a
* @ref MeshVisualizerMaterialUniform buffer bound with * @ref MeshVisualizerMaterialUniform buffer bound with
* @ref bindMaterialBuffer(); as uniform buffers are required to have a * @ref bindMaterialBuffer(). Uniform buffers have a statically defined
* statically defined size. The per-draw materials are then specified * size and @cpp count*sizeof(MeshVisualizerMaterialUniform) @ce has to
* via @ref MeshVisualizerDrawUniform3D::materialId. Default value is * be within @ref GL::AbstractShaderProgram::maxUniformBlockSize().
*
* The per-draw materials are then specified via
* @ref MeshVisualizerDrawUniform3D::materialId. Default value is
* @cpp 1 @ce. * @cpp 1 @ce.
* *
* If @ref Flag::UniformBuffers isn't set, this value is ignored. * 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_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setMaterialCount(UnsignedInt materialCount) { Configuration& setMaterialCount(UnsignedInt count) {
_materialCount = materialCount; _materialCount = count;
return *this; return *this;
} }
@ -3266,9 +3283,15 @@ class MeshVisualizerGL3D::Configuration {
* @ref TransformationUniform3D / @ref MeshVisualizerDrawUniform3D / * @ref TransformationUniform3D / @ref MeshVisualizerDrawUniform3D /
* @ref TextureTransformationUniform buffer bound with * @ref TextureTransformationUniform buffer bound with
* @ref bindTransformationBuffer(), @ref bindDrawBuffer() and * @ref bindTransformationBuffer(), @ref bindDrawBuffer() and
* @ref bindTextureTransformationBuffer(); as uniform buffers are * @ref bindTextureTransformationBuffer(). Uniform buffers have a
* required to have a statically defined size. The draw offset is then * statically defined size and the maximum of
* set via @ref setDrawOffset(). Default value is @cpp 1 @ce. * @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setMaterialCount(), * @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_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setDrawCount(UnsignedInt drawCount) { Configuration& setDrawCount(UnsignedInt count) {
_drawCount = drawCount; _drawCount = count;
return *this; return *this;
} }
#endif #endif

50
src/Magnum/Shaders/PhongGL.h

@ -2144,12 +2144,14 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration {
* accepted by @ref setLightPosition() / @ref setLightPositions(), * accepted by @ref setLightPosition() / @ref setLightPositions(),
* @ref setLightColor() / @ref setLightColors(), * @ref setLightColor() / @ref setLightColors(),
* @ref setLightSpecularColor() / @ref setLightSpecularColors() and * @ref setLightSpecularColor() / @ref setLightSpecularColors() and
* @ref setLightRange() / @ref setLightRanges(). * @ref setLightRange() / @ref setLightRanges(). If
* * @ref Flag::UniformBuffers is set, describes size of a
* If @ref Flag::UniformBuffers is set, describes size of a * @ref PhongLightUniform buffer bound with @ref bindLightBuffer().
* @ref PhongLightUniform buffer bound with @ref bindLightBuffer(); as * Uniform buffers have a statically defined size and
* uniform buffers are required to have a statically defined size. The * @cpp count*sizeof(PhongLightUniform) @ce has to be within
* per-draw lights are then specified via * @ref GL::AbstractShaderProgram::maxUniformBlockSize().
*
* The per-draw lights are then specified via
* @ref PhongDrawUniform::lightOffset and * @ref PhongDrawUniform::lightOffset and
* @ref PhongDrawUniform::lightCount. * @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 * bound on how many joint matrices get supplied to each draw with
* @ref setJointMatrices() / @ref setJointMatrix(). If * @ref setJointMatrices() / @ref setJointMatrix(). If
* @ref Flag::UniformBuffers is set, @p count describes size of a * @ref Flag::UniformBuffers is set, @p count describes size of a
* @ref TransformationUniform3D buffer bound with @ref bindJointBuffer(); * @ref TransformationUniform3D buffer bound with
* as uniform buffers are required to have a statically defined size. * @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 * The per-vertex joints then index into the array offset by
* @ref PhongDrawUniform::jointOffset. If @p count is @cpp 0 @ce, * @ref PhongDrawUniform::jointOffset. If @p count is @cpp 0 @ce,
* skinning is not performed. * skinning is not performed.
@ -2237,9 +2242,12 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration {
* *
* If @ref Flag::UniformBuffers is set, describes size of a * If @ref Flag::UniformBuffers is set, describes size of a
* @ref PhongMaterialUniform buffer bound with * @ref PhongMaterialUniform buffer bound with
* @ref bindMaterialBuffer(); as uniform buffers are required to have a * @ref bindMaterialBuffer(). Uniform buffers have a statically defined
* statically defined size. The per-draw materials are then specified * size and @cpp count*sizeof(PhongMaterialUniform) @ce has to be
* via @ref PhongDrawUniform::materialId. Default value is @cpp 1 @ce. * 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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setLightCount(), @ref setDrawCount(), * @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_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setMaterialCount(UnsignedInt materialCount) { Configuration& setMaterialCount(UnsignedInt count) {
_materialCount = materialCount; _materialCount = count;
return *this; return *this;
} }
@ -2268,9 +2276,15 @@ class MAGNUM_SHADERS_EXPORT PhongGL::Configuration {
* @ref TransformationUniform3D / @ref PhongDrawUniform / * @ref TransformationUniform3D / @ref PhongDrawUniform /
* @ref TextureTransformationUniform buffer bound with * @ref TextureTransformationUniform buffer bound with
* @ref bindTransformationBuffer(), @ref bindDrawBuffer() and * @ref bindTransformationBuffer(), @ref bindDrawBuffer() and
* @ref bindTextureTransformationBuffer(); as uniform buffers are * @ref bindTextureTransformationBuffer(). Uniform buffers have a
* required to have a statically defined size. The draw offset is then * statically defined size and the maximum of
* set via @ref setDrawOffset(). Default value is @cpp 1 @ce. * @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setLightCount(), @ref setMaterialCount(), * @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_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setDrawCount(UnsignedInt drawCount) { Configuration& setDrawCount(UnsignedInt count) {
_drawCount = drawCount; _drawCount = count;
return *this; return *this;
} }
#endif #endif

31
src/Magnum/Shaders/VectorGL.h

@ -624,9 +624,12 @@ template<UnsignedInt dimensions> class VectorGL<dimensions>::Configuration {
* *
* If @ref Flag::UniformBuffers is set, describes size of a * If @ref Flag::UniformBuffers is set, describes size of a
* @ref VectorMaterialUniform buffer bound with * @ref VectorMaterialUniform buffer bound with
* @ref bindMaterialBuffer(); as uniform buffers are required to have a * @ref bindMaterialBuffer(). Uniform buffers have a statically defined
* statically defined size. The per-draw materials are then specified * size and @cpp count*sizeof(VectorMaterialUniform) @ce has to be
* via @ref VectorDrawUniform::materialId. Default value is @cpp 1 @ce. * 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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setDrawCount(), * @see @ref setFlags(), @ref setDrawCount(),
@ -635,8 +638,8 @@ template<UnsignedInt dimensions> class VectorGL<dimensions>::Configuration {
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setMaterialCount(UnsignedInt materialCount) { Configuration& setMaterialCount(UnsignedInt count) {
_materialCount = materialCount; _materialCount = count;
return *this; return *this;
} }
@ -656,10 +659,16 @@ template<UnsignedInt dimensions> class VectorGL<dimensions>::Configuration {
* @ref TransformationProjectionUniform3D / * @ref TransformationProjectionUniform3D /
* @ref VectorDrawUniform / @ref TextureTransformationUniform buffer * @ref VectorDrawUniform / @ref TextureTransformationUniform buffer
* bound with @ref bindTransformationProjectionBuffer(), * bound with @ref bindTransformationProjectionBuffer(),
* @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer(); as * @ref bindDrawBuffer() and @ref bindTextureTransformationBuffer().
* uniform buffers are required to have a statically defined size. The * Uniform buffers have a statically defined size and the maximum of
* draw offset is then set via @ref setDrawOffset(). Default value is * @cpp count*sizeof(TransformationProjectionUniform2D) @ce /
* @cpp 1 @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref setMaterialCount(), * @see @ref setFlags(), @ref setMaterialCount(),
@ -668,8 +677,8 @@ template<UnsignedInt dimensions> class VectorGL<dimensions>::Configuration {
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setDrawCount(UnsignedInt drawCount) { Configuration& setDrawCount(UnsignedInt count) {
_drawCount = drawCount; _drawCount = count;
return *this; return *this;
} }
#endif #endif

15
src/Magnum/Shaders/VertexColorGL.h

@ -476,9 +476,14 @@ template<UnsignedInt dimensions> class VertexColorGL<dimensions>::Configuration
* If @ref Flag::UniformBuffers is set, describes size of a * If @ref Flag::UniformBuffers is set, describes size of a
* @ref TransformationProjectionUniform2D / * @ref TransformationProjectionUniform2D /
* @ref TransformationProjectionUniform3D buffer bound with * @ref TransformationProjectionUniform3D buffer bound with
* @ref bindTransformationProjectionBuffer(); as uniform buffers are * @ref bindTransformationProjectionBuffer(). Uniform buffers have a
* required to have a statically defined size. The draw offset is then * statically defined size and
* set via @ref setDrawOffset(). Default value is @cpp 1 @ce. * @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. * If @ref Flag::UniformBuffers isn't set, this value is ignored.
* @see @ref setFlags(), @ref VertexColorGL::drawCount() * @see @ref setFlags(), @ref VertexColorGL::drawCount()
@ -486,8 +491,8 @@ template<UnsignedInt dimensions> class VertexColorGL<dimensions>::Configuration
* @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0. * @requires_gles30 Uniform buffers are not available in OpenGL ES 2.0.
* @requires_webgl20 Uniform buffers are not available in WebGL 1.0. * @requires_webgl20 Uniform buffers are not available in WebGL 1.0.
*/ */
Configuration& setDrawCount(UnsignedInt drawCount) { Configuration& setDrawCount(UnsignedInt count) {
_drawCount = drawCount; _drawCount = count;
return *this; return *this;
} }
#endif #endif

Loading…
Cancel
Save