From 4276d65a75b122bde19989b5631e82af038238d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 6 Jul 2015 12:26:45 +0200 Subject: [PATCH] Implemented EXT_texture_border_clamp AEP extension. Replaced NV_texture_border_clamp enum values with EXT ones, as this is a superset of the NV extension. --- doc/opengl-support.dox | 2 +- src/Magnum/AbstractTexture.cpp | 52 +++++++++++++++++----- src/Magnum/AbstractTexture.h | 6 +-- src/Magnum/CubeMapTexture.h | 22 ++++++--- src/Magnum/Implementation/TextureState.cpp | 2 +- src/Magnum/Implementation/TextureState.h | 2 +- src/Magnum/Sampler.h | 6 ++- src/Magnum/Test/CubeMapTextureGLTest.cpp | 18 +++++--- src/Magnum/Test/TextureArrayGLTest.cpp | 20 +++++++-- src/Magnum/Test/TextureGLTest.cpp | 32 ++++++++++--- src/Magnum/Texture.h | 22 ++++++--- src/Magnum/TextureArray.h | 16 ++++--- 12 files changed, 144 insertions(+), 56 deletions(-) diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index 0a0d08b8c..f4103630a 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -366,7 +366,7 @@ Extension | Status @es_extension{EXT,gpu_shader5} | done (shading language only) @es_extension{EXT,shader_io_blocks} | done (shading language only) @es_extension{EXT,tessellation_shader} | | -@es_extension{EXT,texture_border_clamp} | | +@es_extension{EXT,texture_border_clamp} | done @es_extension{EXT,texture_buffer} | | @es_extension{EXT,texture_cube_map_array} | | @es_extension{EXT,primitive_bounding_box} | | diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/AbstractTexture.cpp index f4441e55f..20bddde41 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/AbstractTexture.cpp @@ -332,23 +332,37 @@ void AbstractTexture::setLodBias(const Float bias) { #ifndef MAGNUM_TARGET_WEBGL void AbstractTexture::setBorderColor(const Color4& color) { - #ifndef MAGNUM_TARGET_GLES - (this->*Context::current()->state().texture->parameterfvImplementation)(GL_TEXTURE_BORDER_COLOR, color.data()); - #else - (this->*Context::current()->state().texture->parameterfvImplementation)(GL_TEXTURE_BORDER_COLOR_NV, color.data()); - #endif + (this->*Context::current()->state().texture->parameterfvImplementation)( + #ifndef MAGNUM_TARGET_GLES + GL_TEXTURE_BORDER_COLOR, + #else + GL_TEXTURE_BORDER_COLOR_EXT, + #endif + color.data()); } -#endif -#ifndef MAGNUM_TARGET_GLES +#ifndef MAGNUM_TARGET_GLES2 void AbstractTexture::setBorderColor(const Vector4ui& color) { - (this->*Context::current()->state().texture->parameterIuivImplementation)(GL_TEXTURE_BORDER_COLOR, color.data()); + (this->*Context::current()->state().texture->parameterIuivImplementation)( + #ifndef MAGNUM_TARGET_GLES + GL_TEXTURE_BORDER_COLOR, + #else + GL_TEXTURE_BORDER_COLOR_EXT, + #endif + color.data()); } void AbstractTexture::setBorderColor(const Vector4i& color) { - (this->*Context::current()->state().texture->parameterIivImplementation)(GL_TEXTURE_BORDER_COLOR, color.data()); + (this->*Context::current()->state().texture->parameterIivImplementation)( + #ifndef MAGNUM_TARGET_GLES + GL_TEXTURE_BORDER_COLOR, + #else + GL_TEXTURE_BORDER_COLOR_EXT, + #endif + color.data()); } #endif +#endif void AbstractTexture::setMaxAnisotropy(const Float anisotropy) { (this->*Context::current()->state().texture->setMaxAnisotropyImplementation)(anisotropy); @@ -926,12 +940,18 @@ void AbstractTexture::parameterImplementationDSAEXT(GLenum parameter, const GLfl } #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void AbstractTexture::parameterIImplementationDefault(GLenum parameter, const GLuint* values) { bindInternal(); - glTexParameterIuiv(_target, parameter, values); + #ifndef MAGNUM_TARGET_GLES + glTexParameterIuiv + #else + glTexParameterIuivEXT + #endif + (_target, parameter, values); } +#ifndef MAGNUM_TARGET_GLES void AbstractTexture::parameterIImplementationDSA(const GLenum parameter, const GLuint* const values) { glTextureParameterIuiv(_id, parameter, values); } @@ -940,12 +960,19 @@ void AbstractTexture::parameterIImplementationDSAEXT(GLenum parameter, const GLu _flags |= ObjectFlag::Created; glTextureParameterIuivEXT(_id, _target, parameter, values); } +#endif void AbstractTexture::parameterIImplementationDefault(GLenum parameter, const GLint* values) { bindInternal(); - glTexParameterIiv(_target, parameter, values); + #ifndef MAGNUM_TARGET_GLES + glTexParameterIiv + #else + glTexParameterIivEXT + #endif + (_target, parameter, values); } +#ifndef MAGNUM_TARGET_GLES void AbstractTexture::parameterIImplementationDSA(const GLenum parameter, const GLint* const values) { glTextureParameterIiv(_id, parameter, values); } @@ -955,6 +982,7 @@ void AbstractTexture::parameterIImplementationDSAEXT(GLenum parameter, const GLi glTextureParameterIivEXT(_id, _target, parameter, values); } #endif +#endif void AbstractTexture::setMaxAnisotropyImplementationNoOp(GLfloat) {} diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/AbstractTexture.h index 4e1967dc6..7c98a8075 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/AbstractTexture.h @@ -368,11 +368,11 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { #endif #ifndef MAGNUM_TARGET_WEBGL void setBorderColor(const Color4& color); - #endif - #ifndef MAGNUM_TARGET_GLES + #ifndef MAGNUM_TARGET_GLES2 void setBorderColor(const Vector4i& color); void setBorderColor(const Vector4ui& color); #endif + #endif void setMaxAnisotropy(Float anisotropy); #ifndef MAGNUM_TARGET_WEBGL void setSRGBDecode(bool decode); @@ -440,7 +440,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { void MAGNUM_LOCAL parameterImplementationDefault(GLenum parameter, const GLint* values); #endif void MAGNUM_LOCAL parameterImplementationDefault(GLenum parameter, const GLfloat* values); - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void MAGNUM_LOCAL parameterIImplementationDefault(GLenum parameter, const GLuint* values); void MAGNUM_LOCAL parameterIImplementationDefault(GLenum parameter, const GLint* values); #endif diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/CubeMapTexture.h index 20da14b89..ce94f5c3a 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/CubeMapTexture.h @@ -257,16 +257,17 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * See @ref Texture::setBorderColor(const Color4&) for more * information. - * @requires_es_extension Extension @es_extension{NV,texture_border_clamp} + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} or + * @es_extension{NV,texture_border_clamp} * @requires_gles Border clamp is not available in WebGL. */ CubeMapTexture& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; } - #endif - #ifndef MAGNUM_TARGET_GLES + #ifndef MAGNUM_TARGET_GLES2 /** * @copybrief Texture::setBorderColor(const Vector4ui&) * @return Reference to self (for method chaining) @@ -274,8 +275,11 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * See @ref Texture::setBorderColor(const Vector4ui&) for more * information. * @requires_gl30 Extension @extension{EXT,texture_integer} - * @requires_gl Border clamp is available only for float textures in - * OpenGL ES. Border clamp is not available in WebGL. + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_es_extension Extension + * @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} + * @requires_gles Border clamp is not available in WebGL. */ CubeMapTexture& setBorderColor(const Vector4ui& color) { AbstractTexture::setBorderColor(color); @@ -284,14 +288,18 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { /** @overload * @requires_gl30 Extension @extension{EXT,texture_integer} - * @requires_gl Border clamp is available only for float textures in - * OpenGL ES. Border clamp is not available in WebGL. + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_es_extension Extension + * @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} + * @requires_gles Border clamp is not available in WebGL. */ CubeMapTexture& setBorderColor(const Vector4i& color) { AbstractTexture::setBorderColor(color); return *this; } #endif + #endif /** * @copybrief Texture::setMaxAnisotropy() diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 4fd45189c..0622ec952 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -165,7 +165,7 @@ TextureState::TextureState(Context& context, std::vector& extension parameterivImplementation = &AbstractTexture::parameterImplementationDefault; #endif parameterfvImplementation = &AbstractTexture::parameterImplementationDefault; - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) parameterIuivImplementation = &AbstractTexture::parameterIImplementationDefault; parameterIivImplementation = &AbstractTexture::parameterIImplementationDefault; #endif diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 19d9702ee..3a8578f96 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -48,7 +48,7 @@ struct TextureState { void(AbstractTexture::*parameterivImplementation)(GLenum, const GLint*); #endif void(AbstractTexture::*parameterfvImplementation)(GLenum, const GLfloat*); - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void(AbstractTexture::*parameterIuivImplementation)(GLenum, const GLuint*); void(AbstractTexture::*parameterIivImplementation)(GLenum, const GLint*); #endif diff --git a/src/Magnum/Sampler.h b/src/Magnum/Sampler.h index 8ffd5b212..9705582cb 100644 --- a/src/Magnum/Sampler.h +++ b/src/Magnum/Sampler.h @@ -121,13 +121,15 @@ class MAGNUM_EXPORT Sampler { * Clamp to border color. Coordinates out of range will be clamped * to border color (set with * @ref Texture::setBorderColor() "*Texture::setBorderColor()"). - * @requires_es_extension Extension @es_extension{NV,texture_border_clamp} + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} or + * @es_extension{NV,texture_border_clamp} * @requires_gles Border clamp is not available in WebGL. */ #ifndef MAGNUM_TARGET_GLES ClampToBorder = GL_CLAMP_TO_BORDER, #else - ClampToBorder = GL_CLAMP_TO_BORDER_NV, + ClampToBorder = GL_CLAMP_TO_BORDER_EXT, #endif #endif diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/Test/CubeMapTextureGLTest.cpp index bf4faf92f..a6dbcc452 100644 --- a/src/Magnum/Test/CubeMapTextureGLTest.cpp +++ b/src/Magnum/Test/CubeMapTextureGLTest.cpp @@ -56,7 +56,7 @@ struct CubeMapTextureGLTest: AbstractOpenGLTester { void samplingMaxLevel(); void samplingCompare(); #endif - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void samplingBorderInteger(); #endif #ifndef MAGNUM_TARGET_GLES2 @@ -107,7 +107,7 @@ CubeMapTextureGLTest::CubeMapTextureGLTest() { &CubeMapTextureGLTest::samplingMaxLevel, &CubeMapTextureGLTest::samplingCompare, #endif - #ifndef MAGNUM_TARGET_GLES + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &CubeMapTextureGLTest::samplingBorderInteger, #endif #ifndef MAGNUM_TARGET_GLES2 @@ -278,10 +278,15 @@ void CubeMapTextureGLTest::samplingCompare() { } #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void CubeMapTextureGLTest::samplingBorderInteger() { + #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + #else + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + #endif CubeMapTexture a; a.setWrapping(Sampler::Wrapping::ClampToBorder) @@ -312,9 +317,10 @@ void CubeMapTextureGLTest::samplingDepthStencilMode() { #endif #ifdef MAGNUM_TARGET_GLES -void CubeMapTextureGLTest::samplingBorder2D() { - if(!Context::current()->isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::texture_border_clamp::string() + std::string(" is not supported.")); +void CubeMapTextureGLTest::samplingBorder() { + if(!Context::current()->isExtensionSupported() && + !Context::current()->isExtensionSupported()) + CORRADE_SKIP("No required extension is supported."); CubeMapTexture texture; texture.setWrapping(Sampler::Wrapping::ClampToBorder) diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/Test/TextureArrayGLTest.cpp index 175be35c3..b6df42004 100644 --- a/src/Magnum/Test/TextureArrayGLTest.cpp +++ b/src/Magnum/Test/TextureArrayGLTest.cpp @@ -79,7 +79,11 @@ struct TextureArrayGLTest: AbstractOpenGLTester { #ifndef MAGNUM_TARGET_GLES void samplingBorderInteger1D(); + #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void samplingBorderInteger2D(); + #endif + #ifndef MAGNUM_TARGET_GLES void samplingDepthStencilMode1D(); #endif #ifndef MAGNUM_TARGET_GLES2 @@ -172,7 +176,11 @@ TextureArrayGLTest::TextureArrayGLTest() { #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::samplingBorderInteger1D, + #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &TextureArrayGLTest::samplingBorderInteger2D, + #endif + #ifndef MAGNUM_TARGET_GLES &TextureArrayGLTest::samplingDepthStencilMode1D, #endif #ifndef MAGNUM_TARGET_GLES2 @@ -524,12 +532,17 @@ void TextureArrayGLTest::samplingCompare2D() { } #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureArrayGLTest::samplingBorderInteger2D() { + #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_array::string() + std::string(" is not supported.")); if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + #else + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + #endif Texture2DArray a; a.setWrapping(Sampler::Wrapping::ClampToBorder) @@ -563,8 +576,9 @@ void TextureArrayGLTest::samplingDepthStencilMode2D() { #ifdef MAGNUM_TARGET_GLES void TextureArrayGLTest::samplingBorder2D() { - if(!Context::current()->isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported() && + !Context::current()->isExtensionSupported()) + CORRADE_SKIP("No required extension is supported."); Texture2DArray texture; texture.setWrapping(Sampler::Wrapping::ClampToBorder) diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/Test/TextureGLTest.cpp index ad91b8d2e..b39c08ee9 100644 --- a/src/Magnum/Test/TextureGLTest.cpp +++ b/src/Magnum/Test/TextureGLTest.cpp @@ -89,8 +89,12 @@ struct TextureGLTest: AbstractOpenGLTester { #ifndef MAGNUM_TARGET_GLES void samplingBorderInteger1D(); + #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void samplingBorderInteger2D(); void samplingBorderInteger3D(); + #endif + #ifndef MAGNUM_TARGET_GLES void samplingDepthStencilMode1D(); #endif #ifndef MAGNUM_TARGET_GLES2 @@ -214,8 +218,12 @@ TextureGLTest::TextureGLTest() { #ifndef MAGNUM_TARGET_GLES &TextureGLTest::samplingBorderInteger1D, + #endif + #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) &TextureGLTest::samplingBorderInteger2D, &TextureGLTest::samplingBorderInteger3D, + #endif + #ifndef MAGNUM_TARGET_GLES &TextureGLTest::samplingDepthStencilMode1D, #endif #ifndef MAGNUM_TARGET_GLES2 @@ -617,10 +625,15 @@ void TextureGLTest::samplingCompare2D() { } #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorderInteger2D() { + #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + #else + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + #endif Texture2D a; a.setWrapping(Sampler::Wrapping::ClampToBorder) @@ -652,8 +665,9 @@ void TextureGLTest::samplingDepthStencilMode2D() { #ifdef MAGNUM_TARGET_GLES void TextureGLTest::samplingBorder2D() { - if(!Context::current()->isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported() && + !Context::current()->isExtensionSupported()) + CORRADE_SKIP("No required extension is supported."); Texture2D texture; texture.setWrapping(Sampler::Wrapping::ClampToBorder) @@ -734,10 +748,15 @@ void TextureGLTest::samplingMaxLevel3D() { } #endif -#ifndef MAGNUM_TARGET_GLES +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void TextureGLTest::samplingBorderInteger3D() { + #ifndef MAGNUM_TARGET_GLES if(!Context::current()->isExtensionSupported()) CORRADE_SKIP(Extensions::GL::EXT::texture_integer::string() + std::string(" is not supported.")); + #else + if(!Context::current()->isExtensionSupported()) + CORRADE_SKIP(Extensions::GL::EXT::texture_border_clamp::string() + std::string(" is not supported.")); + #endif Texture3D a; a.setWrapping(Sampler::Wrapping::ClampToBorder) @@ -774,8 +793,9 @@ void TextureGLTest::samplingBorder3D() { CORRADE_SKIP(Extensions::GL::OES::texture_3D::string() + std::string(" is not supported.")); #endif - if(!Context::current()->isExtensionSupported()) - CORRADE_SKIP(Extensions::GL::NV::texture_border_clamp::string() + std::string(" is not supported.")); + if(!Context::current()->isExtensionSupported() && + !Context::current()->isExtensionSupported()) + CORRADE_SKIP("No required extension is supported."); Texture3D texture; texture.setWrapping(Sampler::Wrapping::ClampToBorder) diff --git a/src/Magnum/Texture.h b/src/Magnum/Texture.h index 3c26ba806..a52d452d1 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/Texture.h @@ -366,16 +366,17 @@ template class Texture: public AbstractTexture { * @fn_gl_extension{TextureParameter,EXT,direct_state_access}, * eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and * @fn_gl{TexParameter} with @def_gl{TEXTURE_BORDER_COLOR} - * @requires_es_extension Extension @es_extension{NV,texture_border_clamp} + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} or + * @es_extension{NV,texture_border_clamp} * @requires_gles Border clamp is not available in WebGL. */ Texture& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; } - #endif - #ifndef MAGNUM_TARGET_GLES + #ifndef MAGNUM_TARGET_GLES2 /** * @brief Set border color for integer texture * @return Reference to self (for method chaining) @@ -391,8 +392,11 @@ template class Texture: public AbstractTexture { * eventually @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and * @fn_gl{TexParameter} with @def_gl{TEXTURE_BORDER_COLOR} * @requires_gl30 Extension @extension{EXT,texture_integer} - * @requires_gl Border clamp is available only for float textures in - * OpenGL ES. Border clamp is not available in WebGL. + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_es_extension Extension + * @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} + * @requires_gles Border clamp is not available in WebGL. */ Texture& setBorderColor(const Vector4ui& color) { AbstractTexture::setBorderColor(color); @@ -401,14 +405,18 @@ template class Texture: public AbstractTexture { /** @overload * @requires_gl30 Extension @extension{EXT,texture_integer} - * @requires_gl Border clamp is available only for float textures in - * OpenGL ES. Border clamp is not available in WebGL. + * @requires_gles30 Not defined in OpenGL ES 2.0. + * @requires_es_extension Extension + * @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} + * @requires_gles Border clamp is not available in WebGL. */ Texture& setBorderColor(const Vector4i& color) { AbstractTexture::setBorderColor(color); return *this; } #endif + #endif /** * @brief Set max anisotropy diff --git a/src/Magnum/TextureArray.h b/src/Magnum/TextureArray.h index 85894bb56..6f8fa242d 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/TextureArray.h @@ -248,16 +248,16 @@ template class TextureArray: public AbstractTexture { * * See @ref Texture::setBorderColor(const Color4&) for more * information. - * @requires_es_extension Extension @es_extension{NV,texture_border_clamp} + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} or + * @es_extension{NV,texture_border_clamp} * @requires_gles Border clamp is not available in WebGL. */ TextureArray& setBorderColor(const Color4& color) { AbstractTexture::setBorderColor(color); return *this; } - #endif - #ifndef MAGNUM_TARGET_GLES /** * @copybrief Texture::setBorderColor(const Vector4ui&) * @return Reference to self (for method chaining) @@ -265,8 +265,9 @@ template class TextureArray: public AbstractTexture { * See @ref Texture::setBorderColor(const Vector4ui&) for more * information. * @requires_gl30 Extension @extension{EXT,texture_integer} - * @requires_gl Border clamp is available only for float textures in - * OpenGL ES. Border clamp is not available in WebGL. + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} + * @requires_gles Border clamp is not available in WebGL. */ TextureArray& setBorderColor(const Vector4ui& color) { AbstractTexture::setBorderColor(color); @@ -275,8 +276,9 @@ template class TextureArray: public AbstractTexture { /** @overload * @requires_gl30 Extension @extension{EXT,texture_integer} - * @requires_gl Border clamp is available only for float textures in - * OpenGL ES. Border clamp is not available in WebGL. + * @requires_es_extension Extension @es_extension{ANDROID,extension_pack_es31a}/ + * @es_extension{EXT,texture_border_clamp} + * @requires_gles Border clamp is not available in WebGL. */ TextureArray& setBorderColor(const Vector4i& color) { AbstractTexture::setBorderColor(color);