diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 2dc68ab42..dd0b01f73 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -52,7 +52,7 @@ Int AbstractShaderProgram::maxVertexAttributes() { return value; } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Int AbstractShaderProgram::maxAtomicCounterBufferSize() { #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) @@ -133,6 +133,7 @@ Int AbstractShaderProgram::maxImageSamples() { #endif #ifndef MAGNUM_TARGET_GLES2 +#ifndef MAGNUM_TARGET_WEBGL Int AbstractShaderProgram::maxCombinedShaderOutputResources() { #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported() || !Context::current()->isExtensionSupported()) @@ -166,7 +167,6 @@ Long AbstractShaderProgram::maxShaderStorageBlockSize() { } #endif -#ifndef MAGNUM_TARGET_GLES2 Int AbstractShaderProgram::maxUniformBlockSize() { #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) @@ -180,9 +180,8 @@ Int AbstractShaderProgram::maxUniformBlockSize() { return value; } -#endif -#ifndef MAGNUM_TARGET_GLES2 +#ifndef MAGNUM_TARGET_WEBGL Int AbstractShaderProgram::maxUniformLocations() { #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) @@ -200,7 +199,6 @@ Int AbstractShaderProgram::maxUniformLocations() { } #endif -#ifndef MAGNUM_TARGET_GLES2 Int AbstractShaderProgram::minTexelOffset() { #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) @@ -410,14 +408,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform1fv(location, count, values); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const GLfloat* const values) { glProgramUniform1fv(_id, location, count, values); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const GLfloat* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform1fvEXT(_id, location, count, values); #else static_cast(location); @@ -426,6 +425,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<2, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniform2fvImplementation)(location, count, values); @@ -436,14 +436,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform2fv(location, count, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<2, GLfloat>* const values) { glProgramUniform2fv(_id, location, count, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<2, GLfloat>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform2fvEXT(_id, location, count, values[0].data()); #else static_cast(location); @@ -452,6 +453,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<3, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniform3fvImplementation)(location, count, values); @@ -462,14 +464,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform3fv(location, count, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<3, GLfloat>* const values) { glProgramUniform3fv(_id, location, count, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<3, GLfloat>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform3fvEXT(_id, location, count, values[0].data()); #else static_cast(location); @@ -478,6 +481,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<4, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniform4fvImplementation)(location, count, values); @@ -488,14 +492,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform4fv(location, count, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<4, GLfloat>* const values) { glProgramUniform4fv(_id, location, count, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<4, GLfloat>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform4fvEXT(_id, location, count, values[0].data()); #else static_cast(location); @@ -504,6 +509,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Int* const values) { (this->*Context::current()->state().shaderProgram->uniform1ivImplementation)(location, count, values); @@ -514,14 +520,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform1iv(location, count, values); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const GLint* const values) { glProgramUniform1iv(_id, location, count, values); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const GLint* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform1ivEXT(_id, location, count, values); #else static_cast(location); @@ -530,6 +537,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<2, Int>* const values) { (this->*Context::current()->state().shaderProgram->uniform2ivImplementation)(location, count, values); @@ -540,14 +548,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform2iv(location, count, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<2, GLint>* const values) { glProgramUniform2iv(_id, location, count, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<2, GLint>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform2ivEXT(_id, location, count, values[0].data()); #else static_cast(location); @@ -556,6 +565,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<3, Int>* const values) { (this->*Context::current()->state().shaderProgram->uniform3ivImplementation)(location, count, values); @@ -566,14 +576,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform3iv(location, count, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<3, GLint>* const values) { glProgramUniform3iv(_id, location, count, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<3, GLint>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform3ivEXT(_id, location, count, values[0].data()); #else static_cast(location); @@ -582,6 +593,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<4, Int>* const values) { (this->*Context::current()->state().shaderProgram->uniform4ivImplementation)(location, count, values); @@ -592,14 +604,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform4iv(location, count, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<4, GLint>* const values) { glProgramUniform4iv(_id, location, count, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<4, GLint>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniform4ivEXT(_id, location, count, values[0].data()); #else static_cast(location); @@ -608,6 +621,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif #ifndef MAGNUM_TARGET_GLES2 void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const UnsignedInt* const values) { @@ -619,6 +633,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform1uiv(location, count, values); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const GLuint* const values) { glProgramUniform1uiv(_id, location, count, values); } @@ -626,6 +641,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const GLuint* const values) { glProgramUniform1uivEXT(_id, location, count, values); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<2, UnsignedInt>* const values) { (this->*Context::current()->state().shaderProgram->uniform2uivImplementation)(location, count, values); @@ -636,6 +652,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform2uiv(location, count, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<2, GLuint>* const values) { glProgramUniform2uiv(_id, location, count, values[0].data()); } @@ -643,6 +660,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<2, GLuint>* const values) { glProgramUniform2uivEXT(_id, location, count, values[0].data()); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<3, UnsignedInt>* const values) { (this->*Context::current()->state().shaderProgram->uniform3uivImplementation)(location, count, values); @@ -653,6 +671,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform3uiv(location, count, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<3, GLuint>* const values) { glProgramUniform3uiv(_id, location, count, values[0].data()); } @@ -660,6 +679,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::Vector<3, GLuint>* const values) { glProgramUniform3uivEXT(_id, location, count, values[0].data()); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::Vector<4, UnsignedInt>* const values) { (this->*Context::current()->state().shaderProgram->uniform4uivImplementation)(location, count, values); @@ -670,6 +690,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniform4uiv(location, count, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::Vector<4, GLuint>* const values) { glProgramUniform4uiv(_id, location, count, values[0].data()); } @@ -678,6 +699,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat glProgramUniform4uivEXT(_id, location, count, values[0].data()); } #endif +#endif #ifndef MAGNUM_TARGET_GLES void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Double* const values) { @@ -758,14 +780,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix2fv(location, count, GL_FALSE, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* const values) { glProgramUniformMatrix2fv(_id, location, count, GL_FALSE, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniformMatrix2fvEXT(_id, location, count, GL_FALSE, values[0].data()); #else static_cast(location); @@ -774,6 +797,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<3, 3, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniformMatrix3fvImplementation)(location, count, values); @@ -784,14 +808,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix3fv(location, count, GL_FALSE, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* const values) { glProgramUniformMatrix3fv(_id, location, count, GL_FALSE, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniformMatrix3fvEXT(_id, location, count, GL_FALSE, values[0].data()); #else static_cast(location); @@ -800,6 +825,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<4, 4, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniformMatrix4fvImplementation)(location, count, values); @@ -810,14 +836,15 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix4fv(location, count, GL_FALSE, values[0].data()); } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* const values) { glProgramUniformMatrix4fv(_id, location, count, GL_FALSE, values[0].data()); } #endif +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* const values) { - #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_NACL) + #ifndef CORRADE_TARGET_NACL glProgramUniformMatrix4fvEXT(_id, location, count, GL_FALSE, values[0].data()); #else static_cast(location); @@ -826,6 +853,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat CORRADE_ASSERT_UNREACHABLE(); #endif } +#endif #ifndef MAGNUM_TARGET_GLES2 void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<2, 3, Float>* const values) { @@ -837,6 +865,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix2x3fv(location, count, GL_FALSE, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* const values) { glProgramUniformMatrix2x3fv(_id, location, count, GL_FALSE, values[0].data()); } @@ -844,6 +873,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* const values) { glProgramUniformMatrix2x3fvEXT(_id, location, count, GL_FALSE, values[0].data()); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<3, 2, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniformMatrix3x2fvImplementation)(location, count, values); @@ -854,6 +884,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix3x2fv(location, count, GL_FALSE, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* const values) { glProgramUniformMatrix3x2fv(_id, location, count, GL_FALSE, values[0].data()); } @@ -861,6 +892,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* const values) { glProgramUniformMatrix3x2fvEXT(_id, location, count, GL_FALSE, values[0].data()); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<2, 4, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniformMatrix2x4fvImplementation)(location, count, values); @@ -871,6 +903,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix2x4fv(location, count, GL_FALSE, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* const values) { glProgramUniformMatrix2x4fv(_id, location, count, GL_FALSE, values[0].data()); } @@ -878,6 +911,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* const values) { glProgramUniformMatrix2x4fvEXT(_id, location, count, GL_FALSE, values[0].data()); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<4, 2, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniformMatrix4x2fvImplementation)(location, count, values); @@ -888,6 +922,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix4x2fv(location, count, GL_FALSE, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* const values) { glProgramUniformMatrix4x2fv(_id, location, count, GL_FALSE, values[0].data()); } @@ -895,6 +930,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* const values) { glProgramUniformMatrix4x2fvEXT(_id, location, count, GL_FALSE, values[0].data()); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<3, 4, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniformMatrix3x4fvImplementation)(location, count, values); @@ -905,6 +941,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix3x4fv(location, count, GL_FALSE, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* const values) { glProgramUniformMatrix3x4fv(_id, location, count, GL_FALSE, values[0].data()); } @@ -912,6 +949,7 @@ void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint location, const GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* const values) { glProgramUniformMatrix3x4fvEXT(_id, location, count, GL_FALSE, values[0].data()); } +#endif void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<4, 3, Float>* const values) { (this->*Context::current()->state().shaderProgram->uniformMatrix4x3fvImplementation)(location, count, values); @@ -922,6 +960,7 @@ void AbstractShaderProgram::uniformImplementationDefault(const GLint location, c glUniformMatrix4x3fv(location, count, GL_FALSE, values[0].data()); } +#ifndef MAGNUM_TARGET_WEBGL void AbstractShaderProgram::uniformImplementationSSO(const GLint location, const GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* const values) { glProgramUniformMatrix4x3fv(_id, location, count, GL_FALSE, values[0].data()); } @@ -930,6 +969,7 @@ void AbstractShaderProgram::uniformImplementationDSAEXT_SSOEXT(const GLint locat glProgramUniformMatrix4x3fvEXT(_id, location, count, GL_FALSE, values[0].data()); } #endif +#endif #ifndef MAGNUM_TARGET_GLES void AbstractShaderProgram::setUniform(const Int location, const UnsignedInt count, const Math::RectangularMatrix<2, 2, Double>* const values) { diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index c7c3c1c32..f93a93095 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -188,10 +188,16 @@ bindFragmentDataLocationIndexed(NormalOutput, 1, "normal"); @ref bindAttributeLocation(), @ref bindFragmentDataLocation() or @ref bindFragmentDataLocationIndexed(). @requires_gles30 Explicit location specification of input attributes is not - supported in OpenGL ES 2.0, use @ref bindAttributeLocation() instead. + supported in OpenGL ES 2.0, use @ref bindAttributeLocation() + instead. @requires_gles30 Multiple fragment shader outputs are not available in OpenGL ES 2.0, similar functionality is available in extension - @es_extension{NV,draw_buffers}. + @es_extension{EXT,draw_buffers} or @es_extension{NV,draw_buffers}. +@requires_webgl20 Explicit location specification of input attributes is not + supported in WebGL 1.0, use @ref bindAttributeLocation() instead. +@requires_webgl20 Multiple fragment shader outputs are not available in WebGL + 1.0, similar functionality is available in extension + @webgl_extension{WEBGL,draw_buffers}. @todo @es_extension{EXT,separate_shader_objects} supports explicit attrib location @@ -229,6 +235,8 @@ Int normalMatrixUniform = uniformLocation("normalMatrix"); explicit uniform location instead of using @ref uniformLocation(). @requires_gles31 Explicit uniform location is not supported in OpenGL ES 3.0 and older. Use @ref uniformLocation() instead. +@requires_gles Explicit uniform location is not supported in WebGL. Use + @ref uniformLocation() instead. @anchor AbstractShaderProgram-texture-units ### Specifying texture binding units @@ -262,6 +270,8 @@ setUniform(uniformLocation("specularTexture"), 1); @requires_gles31 Explicit texture binding unit is not supported in OpenGL ES 3.0 and older. Use @ref setUniform(Int, const T&) "setUniform(Int, Int)" instead. +@requires_gles Explicit texture binding unit is not supported in WebGL. Use + @ref setUniform(Int, const T&) "setUniform(Int, Int)" instead. @anchor AbstractShaderProgram-transform-feedback ### Specifying transform feedback binding points @@ -307,7 +317,7 @@ setTransformFeedbackOutputs({ transform feedback output specification instead of using @ref setTransformFeedbackOutputs(). @requires_gl Explicit transform feedback output specification is not available - in OpenGL ES. + in OpenGL ES or WebGL. @anchor AbstractShaderProgram-rendering-workflow ## Rendering workflow @@ -353,7 +363,12 @@ also @ref Attribute::DataType enum for additional type options. matrix attributes and uniforms (i.e. @ref Matrix2x3, @ref Matrix3x2, @ref Matrix2x4, @ref Matrix4x2, @ref Matrix3x4 and @ref Matrix4x3) are not available in OpenGL ES 2.0. -@requires_gl Double attributes and uniforms are not available in OpenGL ES. +@requires_gl Double attributes and uniforms are not available in OpenGL ES or + WebGL. +@requires_webgl20 Integer attributes, unsigned integer uniforms and non-square + matrix attributes and uniforms (i.e. @ref Matrix2x3, @ref Matrix3x2, + @ref Matrix2x4, @ref Matrix4x2, @ref Matrix3x4 and @ref Matrix4x3) are not + available in WebGL 1.0. @anchor AbstractShaderProgram-performance-optimization ## Performance optimizations @@ -389,7 +404,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * @see @ref setTransformFeedbackOutputs() * @requires_gl30 Extension @extension{EXT,transform_feedback} * @requires_gles30 Transform feedback is not available in OpenGL ES - * 2.0 + * 2.0. + * @requires_webgl20 Transform feedback is not available in WebGL 1.0. */ enum class TransformFeedbackBufferMode: GLenum { /** Attributes will be interleaved at one buffer binding point */ @@ -418,7 +434,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL calls. If neither extension @extension{ARB,shader_atomic_counters} * (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_ATOMIC_COUNTER_BUFFER_SIZE} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Atomic counters are not available in WebGL. */ static Int maxAtomicCounterBufferSize(); @@ -429,7 +446,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL calls. If neither extension @extension{ARB,compute_shader} * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_SHARED_MEMORY_SIZE} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Compute shaders are not available in WebGL. */ static Int maxComputeSharedMemorySize(); @@ -440,7 +458,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL calls. If neither extension @extension{ARB,compute_shader} * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_COMPUTE_WORK_GROUP_INVOCATIONS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Compute shaders are not available in WebGL. */ static Int maxComputeWorkGroupInvocations(); @@ -453,7 +472,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL calls. If extension @extension{ARB,shader_image_load_store} * (part of OpenGL 4.2) or OpenGL ES 3.1 is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_IMAGE_UNITS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Shader image load/store is not available in WebGL. */ static Int maxImageUnits(); #endif @@ -467,12 +487,13 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * (part of OpenGL 4.2) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_IMAGE_SAMPLES} * @requires_gl Multisample image load/store is not available in OpenGL - * ES. + * ES or WebGL. */ static Int maxImageSamples(); #endif #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_WEBGL /** * @brief Max supported combined shader output resource count * @@ -481,7 +502,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * (part of OpenGL 4.2) nor extension @extension{ARB,shader_storage_buffer_object} * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_COMBINED_SHADER_OUTPUT_RESOURCES} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Shader image load/store is not available in WebGL. */ static Int maxCombinedShaderOutputResources(); @@ -492,9 +514,11 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL calls. If neither extension @extension{ARB,shader_storage_buffer_object} * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_SHADER_STORAGE_BLOCK_SIZE} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Shader storage is not available in WebGL. */ static Long maxShaderStorageBlockSize(); + #endif /** * @brief Max supported uniform block size @@ -503,10 +527,12 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL calls. If extension @extension{ARB,uniform_buffer_object} * (part of OpenGL 3.1) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_UNIFORM_BLOCK_SIZE} - * @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0 + * @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0. + * @requires_webgl20 Uniform blocks are not available in WebGL 1.0. */ static Int maxUniformBlockSize(); + #ifndef MAGNUM_TARGET_WEBGL /** * @brief Max supported explicit uniform location count * @@ -514,9 +540,11 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL calls. If neither extension @extension{ARB,explicit_uniform_location} * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_UNIFORM_LOCATIONS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Explicit uniform location is not available in WebGL. */ static Int maxUniformLocations(); + #endif /** * @brief Min supported program texel offset @@ -526,7 +554,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL 3.0) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MIN_PROGRAM_TEXEL_OFFSET} * @requires_gles30 Texture lookup with offset is not available in - * OpenGL ES 2.0 + * OpenGL ES 2.0. + * @requires_webgl20 Texture lookup with offset is not available in + * WebGL 1.0. */ static Int minTexelOffset(); @@ -538,7 +568,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * OpenGL 3.0) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_PROGRAM_TEXEL_OFFSET} * @requires_gles30 Texture lookup with offset is not available in - * OpenGL ES 2.0 + * OpenGL ES 2.0. + * @requires_webgl20 Texture lookup with offset is not available in + * WebGL 1.0. */ static Int maxTexelOffset(); #endif @@ -645,7 +677,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { */ static bool link(std::initializer_list> shaders); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /** * @brief Allow retrieving program binary * @@ -653,12 +685,15 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * @see @fn_gl{ProgramParameter} with @def_gl{PROGRAM_BINARY_RETRIEVABLE_HINT} * @requires_gl41 Extension @extension{ARB,get_program_binary} * @requires_gles30 Always allowed in OpenGL ES 2.0. + * @requires_gles Binary program representations are not supported in + * WebGL. */ void setRetrievableBinary(bool enabled) { glProgramParameteri(_id, GL_PROGRAM_BINARY_RETRIEVABLE_HINT, enabled ? GL_TRUE : GL_FALSE); } #endif + #ifndef MAGNUM_TARGET_WEBGL /** * @brief Allow the program to be bound to individual pipeline stages * @@ -666,15 +701,16 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * @see @fn_gl{ProgramParameter} with @def_gl{PROGRAM_SEPARABLE} * @requires_gl41 Extension @extension{ARB,separate_shader_objects} * @requires_es_extension Extension @es_extension{EXT,separate_shader_objects} + * @requires_gles Separate shader objects are not supported in WebGL. */ void setSeparable(bool enabled) { - /** @todo Remove when extension wrangler is available for ES */ #ifndef MAGNUM_TARGET_GLES glProgramParameteri(_id, GL_PROGRAM_SEPARABLE, enabled ? GL_TRUE : GL_FALSE); #else - static_cast(enabled); + glProgramParameteriEXT(_id, GL_PROGRAM_SEPARABLE_EXT, enabled ? GL_TRUE : GL_FALSE); #endif } + #endif /** * @brief Attach shader @@ -731,7 +767,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * for more information. * @requires_gl33 Extension @extension{ARB,blend_func_extended} * @requires_gl Multiple blend function inputs are not available in - * OpenGL ES. + * OpenGL ES or WebGL. */ void bindFragmentDataLocationIndexed(UnsignedInt location, UnsignedInt index, const std::string& name) { bindFragmentDataLocationIndexedInternal(location, index, {name.data(), name.size()}); @@ -755,9 +791,10 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * @ref AbstractShaderProgram-attribute-location "class documentation" * for more information. * @requires_gl30 Extension @extension{EXT,gpu_shader4} - * @requires_gl Use explicit location specification in OpenGL ES 3.0 - * and `gl_FragData[n]` provided by @es_extension2{NV,draw_buffers,GL_NV_draw_buffers} - * in OpenGL ES 2.0. + * @requires_gl Use explicit location specification in OpenGL ES 3.0 or + * WebGL 2.0 and `gl_FragData[n]` provided by @es_extension{NV,draw_buffers} + * in OpenGL ES 2.0 and @webgl_extension{WEBGL,draw_buffers} in + * WebGL 1.0. */ void bindFragmentDataLocation(UnsignedInt location, const std::string& name) { bindFragmentDataLocationInternal(location, {name.data(), name.size()}); @@ -796,9 +833,10 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * using `gl_NextBuffer` or `gl_SkipComponents#` names in * @p outputs array * @requires_gles30 Transform feedback is not available in OpenGL ES - * 2.0 + * 2.0. + * @requires_webgl20 Transform feedback is not available in WebGL 1.0. * @requires_gl Special output names `gl_NextBuffer` and - * `gl_SkipComponents#` are not available in OpenGL ES + * `gl_SkipComponents#` are not available in OpenGL ES or WebGL. */ void setTransformFeedbackOutputs(std::initializer_list outputs, TransformFeedbackBufferMode bufferMode); #endif @@ -898,6 +936,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { * @copydoc setUniform(Int, UnsignedInt, const Float*) * @requires_gl30 Extension @extension{EXT,gpu_shader4} * @requires_gles30 Only signed integers are available in OpenGL ES 2.0. + * @requires_webgl20 Only signed integers are available in WebGL 1.0. */ void setUniform(Int location, UnsignedInt count, const UnsignedInt* values); void setUniform(Int location, UnsignedInt count, const Math::Vector<2, UnsignedInt>* values); /**< @overload */ @@ -909,7 +948,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { /** * @copydoc setUniform(Int, UnsignedInt, const Float*) * @requires_gl40 Extension @extension{ARB,gpu_shader_fp64} - * @requires_gl Only floats are available in OpenGL ES. + * @requires_gl Only floats are available in OpenGL ES or WebGL. */ void setUniform(Int location, UnsignedInt count, const Double* values); void setUniform(Int location, UnsignedInt count, const Math::Vector<2, Double>* values); /**< @overload */ @@ -926,6 +965,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { /** * @copydoc setUniform(Int, UnsignedInt, const Float*) * @requires_gles30 Only square matrices are available in OpenGL ES 2.0. + * @requires_webgl20 Only square matrices are available in WebGL 1.0. */ void setUniform(Int location, UnsignedInt count, const Math::RectangularMatrix<2, 3, Float>* values); void setUniform(Int location, UnsignedInt count, const Math::RectangularMatrix<3, 2, Float>* values); /**< @overload */ @@ -939,7 +979,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { /** * @copydoc setUniform(Int, UnsignedInt, const Float*) * @requires_gl40 Extension @extension{ARB,gpu_shader_fp64} - * @requires_gl Only floats are available in OpenGL ES. + * @requires_gl Only floats are available in OpenGL ES or WebGL. */ void setUniform(Int location, UnsignedInt count, const Math::RectangularMatrix<2, 2, Double>* values); void setUniform(Int location, UnsignedInt count, const Math::RectangularMatrix<3, 3, Double>* values); /**< @overload */ @@ -1007,7 +1047,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLfloat* values); void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); @@ -1027,6 +1067,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); #endif + #ifndef MAGNUM_TARGET_WEBGL void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const GLfloat* values); void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); @@ -1041,6 +1082,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLuint>* values); void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<4, GLuint>* values); #endif + #endif #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const GLdouble* values); void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::Vector<2, GLdouble>* values); @@ -1070,7 +1112,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); @@ -1092,6 +1134,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); #endif + #ifndef MAGNUM_TARGET_WEBGL void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); @@ -1103,6 +1146,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* values); void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* values); #endif + #endif #ifndef MAGNUM_TARGET_GLES void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* values); void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* values); diff --git a/src/Magnum/Attribute.h b/src/Magnum/Attribute.h index 99428d1fc..2faa39b74 100644 --- a/src/Magnum/Attribute.h +++ b/src/Magnum/Attribute.h @@ -138,7 +138,7 @@ template class Attribute { * and @ref DataOption::Normalized. * @requires_gl32 Extension @extension{ARB,vertex_array_bgra} * @requires_gl Only RGBA component ordering is supported in OpenGL - * ES. + * ES and WebGL. */ BGRA = GL_BGRA #endif @@ -162,13 +162,17 @@ template class Attribute { UnsignedInt = GL_UNSIGNED_INT, /**< Unsigned int */ Int = GL_INT, /**< Int */ + #ifndef MAGNUM_TARGET_WEBGL /** * Half float. Only for float attribute types. * @requires_gl30 Extension @extension{ARB,half_float_vertex} * @requires_gles30 Extension @es_extension{OES,vertex_half_float} * in OpenGL ES 2.0 + * @requires_webgl20 Half float vertex attributes are not available + * in WebGL 1.0. */ HalfFloat = GL_HALF_FLOAT, + #endif /** Float. Only for float attribute types. */ Float = GL_FLOAT, @@ -176,7 +180,7 @@ template class Attribute { #ifndef MAGNUM_TARGET_GLES /** * Double. Only for float and double attribute types. - * @requires_gl Only floats are available in OpenGL ES. + * @requires_gl Only floats are available in OpenGL ES or WebGL. */ Double = GL_DOUBLE, @@ -185,7 +189,7 @@ template class Attribute { * vector attribute type. * @requires_gl44 Extension @extension{ARB,vertex_type_10f_11f_11f_rev} * @requires_gl Packed float attributes are not available in OpenGL - * ES. + * ES or WebGL. */ UnsignedInt10f11f11fRev = GL_UNSIGNED_INT_10F_11F_11F_REV, #endif @@ -199,7 +203,9 @@ template class Attribute { * @todo How about (incompatible) @es_extension{OES,vertex_type_10_10_10_2}? * @requires_gl33 Extension @extension{ARB,vertex_type_2_10_10_10_rev} * @requires_gles30 Packed attributes are not available in OpenGL - * ES 2.0 + * ES 2.0. + * @requires_webgl20 Packed attributes are not available in WebGL + * 1.0. */ UnsignedInt2101010Rev = GL_UNSIGNED_INT_2_10_10_10_REV, @@ -208,7 +214,9 @@ template class Attribute { * vector attribute type. * @requires_gl33 Extension @extension{ARB,vertex_type_2_10_10_10_rev} * @requires_gles30 Packed attributes are not available in OpenGL - * ES 2.0 + * ES 2.0. + * @requires_webgl20 Packed attributes are not available in WebGL + * 1.0. */ Int2101010Rev = GL_INT_2_10_10_10_REV #endif diff --git a/src/Magnum/Implementation/ShaderProgramState.cpp b/src/Magnum/Implementation/ShaderProgramState.cpp index b3fc06e4d..1508b40cd 100644 --- a/src/Magnum/Implementation/ShaderProgramState.cpp +++ b/src/Magnum/Implementation/ShaderProgramState.cpp @@ -35,13 +35,19 @@ namespace Magnum { namespace Implementation { ShaderProgramState::ShaderProgramState(Context& context, std::vector& extensions): current(0), maxVertexAttributes(0) #ifndef MAGNUM_TARGET_GLES2 - , maxAtomicCounterBufferSize(0), maxComputeSharedMemorySize(0), maxComputeWorkGroupInvocations(0), maxImageUnits(0), maxCombinedShaderOutputResources(0), maxUniformLocations(0), minTexelOffset(0), maxTexelOffset(0), maxUniformBlockSize(0), maxShaderStorageBlockSize(0) + #ifndef MAGNUM_TARGET_WEBGL + , maxAtomicCounterBufferSize(0), maxComputeSharedMemorySize(0), maxComputeWorkGroupInvocations(0), maxImageUnits(0), maxCombinedShaderOutputResources(0), maxUniformLocations(0) + #endif + , minTexelOffset(0), maxTexelOffset(0), maxUniformBlockSize(0) + #ifndef MAGNUM_TARGET_WEBGL + , maxShaderStorageBlockSize(0) + #endif #endif #ifndef MAGNUM_TARGET_GLES , maxImageSamples(0) #endif { - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #ifndef MAGNUM_TARGET_GLES if(context.isExtensionSupported()) #else @@ -94,6 +100,7 @@ ShaderProgramState::ShaderProgramState(Context& context, std::vector()) #else @@ -149,7 +156,9 @@ ShaderProgramState::ShaderProgramState(Context& context, std::vector(context); + static_cast(extensions); + #endif } void ShaderProgramState::reset() { diff --git a/src/Magnum/Implementation/ShaderProgramState.h b/src/Magnum/Implementation/ShaderProgramState.h index b30c8c2be..d972729d4 100644 --- a/src/Magnum/Implementation/ShaderProgramState.h +++ b/src/Magnum/Implementation/ShaderProgramState.h @@ -87,17 +87,21 @@ struct ShaderProgramState { GLint maxVertexAttributes; #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_WEBGL GLint maxAtomicCounterBufferSize, maxComputeSharedMemorySize, maxComputeWorkGroupInvocations, maxImageUnits, maxCombinedShaderOutputResources, - maxUniformLocations, - minTexelOffset, + maxUniformLocations; + #endif + GLint minTexelOffset, maxTexelOffset, maxUniformBlockSize; + #ifndef MAGNUM_TARGET_WEBGL GLint64 maxShaderStorageBlockSize; #endif + #endif #ifndef MAGNUM_TARGET_GLES GLint maxImageSamples; diff --git a/src/Magnum/Implementation/ShaderState.h b/src/Magnum/Implementation/ShaderState.h index 6c6f678b0..b1afd9619 100644 --- a/src/Magnum/Implementation/ShaderState.h +++ b/src/Magnum/Implementation/ShaderState.h @@ -37,7 +37,7 @@ struct ShaderState { #ifndef MAGNUM_TARGET_GLES maxTessellationControlInputComponents{}, maxTessellationControlOutputComponents{}, maxTessellationControlTotalOutputComponents{}, maxTessellationEvaluationInputComponents{}, maxTessellationEvaluationOutputComponents{}, maxGeometryInputComponents{}, maxGeometryOutputComponents{}, maxGeometryTotalOutputComponents{}, #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) maxAtomicCounterBuffers{}, maxCombinedAtomicCounterBuffers{}, maxAtomicCounters{}, maxCombinedAtomicCounters{}, maxImageUniforms{}, maxCombinedImageUniforms{}, maxShaderStorageBlocks{}, maxCombinedShaderStorageBlocks{}, #endif maxTextureImageUnits{}, maxTextureImageUnitsCombined{}, @@ -70,7 +70,7 @@ struct ShaderState { maxGeometryOutputComponents, maxGeometryTotalOutputComponents; #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) GLint maxAtomicCounterBuffers[StageCount]; GLint maxCombinedAtomicCounterBuffers; GLint maxAtomicCounters[StageCount]; diff --git a/src/Magnum/Shader.cpp b/src/Magnum/Shader.cpp index 789459494..bd2a69b7e 100644 --- a/src/Magnum/Shader.cpp +++ b/src/Magnum/Shader.cpp @@ -59,7 +59,7 @@ std::string shaderName(const Shader::Type type) { case Shader::Type::TessellationControl: return "tessellation control"; case Shader::Type::TessellationEvaluation: return "tessellation evaluation"; #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) case Shader::Type::Compute: return "compute"; #endif case Shader::Type::Fragment: return "fragment"; @@ -72,7 +72,7 @@ UnsignedInt typeToIndex(const Shader::Type type) { switch(type) { case Shader::Type::Vertex: return 0; case Shader::Type::Fragment: return 1; - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) case Shader::Type::Compute: return 2; #endif #ifndef MAGNUM_TARGET_GLES @@ -254,7 +254,7 @@ Int Shader::maxFragmentInputComponents() { return value; } -#ifndef MAGNUM_TARGET_GLES2 +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) Int Shader::maxAtomicCounterBuffers(const Type type) { if( #ifndef MAGNUM_TARGET_GLES @@ -471,7 +471,7 @@ Int Shader::maxTextureImageUnits(const Type type) { constexpr static GLenum what[] = { GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, GL_MAX_TEXTURE_IMAGE_UNITS, - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS, #endif #ifndef MAGNUM_TARGET_GLES @@ -512,7 +512,7 @@ Int Shader::maxUniformBlocks(const Type type) { constexpr static GLenum what[] = { GL_MAX_VERTEX_UNIFORM_BLOCKS, GL_MAX_FRAGMENT_UNIFORM_BLOCKS, - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_WEBGL GL_MAX_COMPUTE_UNIFORM_BLOCKS, #endif #ifndef MAGNUM_TARGET_GLES @@ -555,7 +555,9 @@ Int Shader::maxUniformComponents(const Type type) { constexpr static GLenum what[] = { GL_MAX_VERTEX_UNIFORM_COMPONENTS, GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, + #ifndef MAGNUM_TARGET_WEBGL GL_MAX_COMPUTE_UNIFORM_COMPONENTS, + #endif #ifndef MAGNUM_TARGET_GLES GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS, @@ -596,7 +598,7 @@ Int Shader::maxCombinedUniformComponents(const Type type) { constexpr static GLenum what[] = { GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, - #ifndef MAGNUM_TARGET_GLES2 + #ifndef MAGNUM_TARGET_WEBGL GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS, #endif #ifndef MAGNUM_TARGET_GLES @@ -631,8 +633,10 @@ Shader::Shader(const Version version, const Type type): _type(type), _id(0) { #else case Version::GLES200: _sources.push_back("#version 100\n"); return; case Version::GLES300: _sources.push_back("#version 300 es\n"); return; + #ifndef MAGNUM_TARGET_WEBGL case Version::GLES310: _sources.push_back("#version 310 es\n"); return; #endif + #endif /* The user is responsible for (not) adding #version directive */ case Version::None: return; @@ -799,7 +803,7 @@ Debug operator<<(Debug debug, const Shader::Type value) { _c(TessellationEvaluation) _c(Geometry) #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) _c(Compute) #endif _c(Fragment) diff --git a/src/Magnum/Shader.h b/src/Magnum/Shader.h index 26c3a1be5..b572b4bcd 100644 --- a/src/Magnum/Shader.h +++ b/src/Magnum/Shader.h @@ -71,31 +71,35 @@ class MAGNUM_EXPORT Shader: public AbstractObject { /** * Tessellation control shader * @requires_gl40 Extension @extension{ARB,tessellation_shader} - * @requires_gl Tessellation shaders are not available in OpenGL ES. + * @requires_gl Tessellation shaders are not available in OpenGL ES + * or WebGL. */ TessellationControl = GL_TESS_CONTROL_SHADER, /** * Tessellation evaluation shader * @requires_gl40 Extension @extension{ARB,tessellation_shader} - * @requires_gl Tessellation shaders are not available in OpenGL ES. + * @requires_gl Tessellation shaders are not available in OpenGL ES + * or WebGL. */ TessellationEvaluation = GL_TESS_EVALUATION_SHADER, /** * Geometry shader * @requires_gl32 Extension @extension{ARB,geometry_shader4} - * @requires_gl Geometry shaders are not available in OpenGL ES. + * @requires_gl Geometry shaders are not available in OpenGL ES or + * WebGL. */ Geometry = GL_GEOMETRY_SHADER, #endif - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /** * Compute shader * @requires_gl43 Extension @extension{ARB,compute_shader} * @requires_gles31 Compute shaders are not available in OpenGL ES - * 3.0 and older + * 3.0 and older. + * @requires_gles Compute shaders are not available in WebGL. */ Compute = GL_COMPUTE_SHADER, #endif @@ -125,7 +129,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,tessellation_shader} (part * of OpenGL 4.0) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_TESS_CONTROL_INPUT_COMPONENTS} - * @requires_gl Tessellation shaders are not available in OpenGL ES. + * @requires_gl Tessellation shaders are not available in OpenGL ES or + * WebGL. */ static Int maxTessellationControlInputComponents(); @@ -136,7 +141,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,tessellation_shader} (part * of OpenGL 4.0) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_TESS_CONTROL_OUTPUT_COMPONENTS} - * @requires_gl Tessellation shaders are not available in OpenGL ES. + * @requires_gl Tessellation shaders are not available in OpenGL ES or + * WebGL. */ static Int maxTessellationControlOutputComponents(); @@ -147,7 +153,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,tessellation_shader} (part * of OpenGL 4.0) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS} - * @requires_gl Tessellation shaders are not available in OpenGL ES. + * @requires_gl Tessellation shaders are not available in OpenGL ES or + * WebGL. */ static Int maxTessellationControlTotalOutputComponents(); @@ -158,7 +165,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,tessellation_shader} (part * of OpenGL 4.0) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_TESS_EVALUATION_INPUT_COMPONENTS} - * @requires_gl Tessellation shaders are not available in OpenGL ES. + * @requires_gl Tessellation shaders are not available in OpenGL ES or + * WebGL. */ static Int maxTessellationEvaluationInputComponents(); @@ -169,7 +177,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,tessellation_shader} (part * of OpenGL 4.0) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_TESS_EVALUATION_OUTPUT_COMPONENTS} - * @requires_gl Tessellation shaders are not available in OpenGL ES. + * @requires_gl Tessellation shaders are not available in OpenGL ES or + * WebGL. */ static Int maxTessellationEvaluationOutputComponents(); @@ -180,7 +189,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,geometry_shader4} (part of * OpenGL 3.2) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_GEOMETRY_INPUT_COMPONENTS} - * @requires_gl Geometry shaders are not available in OpenGL ES. + * @requires_gl Geometry shaders are not available in OpenGL ES or + * WebGL. */ static Int maxGeometryInputComponents(); @@ -191,7 +201,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,geometry_shader4} (part of * OpenGL 3.2) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_GEOMETRY_OUTPUT_COMPONENTS} - * @requires_gl Geometry shaders are not available in OpenGL ES. + * @requires_gl Geometry shaders are not available in OpenGL ES or + * WebGL. */ static Int maxGeometryOutputComponents(); @@ -202,7 +213,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * OpenGL calls. If extension @extension{ARB,geometry_shader4} (part of * OpenGL 3.2) is not available, returns `0`. * @see @fn_gl{Get} with @def_gl{MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS} - * @requires_gl Geometry shaders are not available in OpenGL ES. + * @requires_gl Geometry shaders are not available in OpenGL ES or + * WebGL. */ static Int maxGeometryTotalOutputComponents(); #endif @@ -238,7 +250,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject { */ static Int maxUniformComponents(Type type); - #ifndef MAGNUM_TARGET_GLES2 + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) /** * @brief Max supported atomic counter buffer count * @@ -253,7 +265,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * @def_gl{MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS}, * @def_gl{MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS} or * @def_gl{MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Atomic counters are not available in WebGL. */ static Int maxAtomicCounterBuffers(Type type); @@ -265,7 +278,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`. * @see @ref maxAtomicCounterBuffers(), @ref maxCombinedAtomicCounters(), * @fn_gl{Get} with @def_gl{MAX_COMBINED_ATOMIC_COUNTER_BUFFERS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Atomic counters are not available in WebGL. */ static Int maxCombinedAtomicCounterBuffers(); @@ -283,7 +297,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * @def_gl{MAX_GEOMETRY_ATOMIC_COUNTERS}, * @def_gl{MAX_COMPUTE_ATOMIC_COUNTERS} or * @def_gl{MAX_FRAGMENT_ATOMIC_COUNTERS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Atomic counters are not available in WebGL. */ static Int maxAtomicCounters(Type type); @@ -295,7 +310,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`. * @see @ref maxAtomicCounters(), @ref maxCombinedAtomicCounterBuffers(), * @fn_gl{Get} with @def_gl{MAX_COMBINED_ATOMIC_COUNTERS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Atomic counters are not available in WebGL. */ static Int maxCombinedAtomicCounters(); @@ -313,7 +329,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * @def_gl{MAX_GEOMETRY_IMAGE_UNIFORMS}, * @def_gl{MAX_COMPUTE_IMAGE_UNIFORMS} or * @def_gl{MAX_FRAGMENT_IMAGE_UNIFORMS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Shader image load/store is not available in WebGL. */ static Int maxImageUniforms(Type type); @@ -325,7 +342,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * (part of OpenGL 4.2) nor OpenGL ES 3.1 is available, returns `0`. * @see @ref maxImageUniforms(), * @fn_gl{Get} with @def_gl{MAX_COMBINED_IMAGE_UNIFORMS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Shader image load/store is not available in WebGL. */ static Int maxCombinedImageUniforms(); @@ -343,7 +361,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * @def_gl{MAX_GEOMETRY_SHADER_STORAGE_BLOCKS}, * @def_gl{MAX_COMPUTE_SHADER_STORAGE_BLOCKS} or * @def_gl{MAX_FRAGMENT_SHADER_STORAGE_BLOCKS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Shader image load/store is not available in WebGL. */ static Int maxShaderStorageBlocks(Type type); @@ -355,7 +374,8 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * (part of OpenGL 4.3) nor OpenGL ES 3.1 is available, returns `0`. * @see @ref maxShaderStorageBlocks(), * @fn_gl{Get} with @def_gl{MAX_COMBINED_SHADER_STORAGE_BLOCKS} - * @requires_gles30 Not defined in OpenGL ES 2.0 + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_gles Shader storage is not available in WebGL. */ static Int maxCombinedShaderStorageBlocks(); #endif @@ -403,6 +423,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * @def_gl{MAX_COMPUTE_UNIFORM_BLOCKS} or * @def_gl{MAX_FRAGMENT_UNIFORM_BLOCKS} * @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0. + * @requires_webgl20 Uniform blocks are not available in WebGL 1.0. */ static Int maxUniformBlocks(Type type); @@ -416,6 +437,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * @ref maxCombinedUniformComponents(), * @fn_gl{Get} with @def_gl{MAX_COMBINED_UNIFORM_BLOCKS} * @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0. + * @requires_webgl20 Uniform blocks are not available in WebGL 1.0. */ static Int maxCombinedUniformBlocks(); @@ -434,6 +456,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject { * @def_gl{MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS} or * @def_gl{MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS} * @requires_gles30 Uniform blocks are not available in OpenGL ES 2.0. + * @requires_webgl20 Uniform blocks are not available in WebGL 1.0. */ static Int maxCombinedUniformComponents(Type type); #endif