Browse Source

GL: we don't need two code paths that do effectively the same.

The enum value is exactly the same for both.
euler-xxx
Vladimír Vondruš 5 years ago
parent
commit
8b95542497
  1. 8
      src/Magnum/GL/AbstractTexture.cpp
  2. 5
      src/Magnum/GL/AbstractTexture.h
  3. 4
      src/Magnum/GL/Implementation/TextureState.cpp

8
src/Magnum/GL/AbstractTexture.cpp

@ -1280,13 +1280,7 @@ void AbstractTexture::parameterIImplementationDSA(const GLenum parameter, const
void AbstractTexture::setMaxAnisotropyImplementationNoOp(GLfloat) {} void AbstractTexture::setMaxAnisotropyImplementationNoOp(GLfloat) {}
#ifndef MAGNUM_TARGET_GLES void AbstractTexture::setMaxAnisotropyImplementationArbOrExt(GLfloat anisotropy) {
void AbstractTexture::setMaxAnisotropyImplementationArb(GLfloat anisotropy) {
(this->*Context::current().state().texture->parameterfImplementation)(GL_TEXTURE_MAX_ANISOTROPY, anisotropy);
}
#endif
void AbstractTexture::setMaxAnisotropyImplementationExt(GLfloat anisotropy) {
(this->*Context::current().state().texture->parameterfImplementation)( (this->*Context::current().state().texture->parameterfImplementation)(
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
GL_TEXTURE_MAX_ANISOTROPY GL_TEXTURE_MAX_ANISOTROPY

5
src/Magnum/GL/AbstractTexture.h

@ -586,10 +586,7 @@ class MAGNUM_GL_EXPORT AbstractTexture: public AbstractObject {
#endif #endif
void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationNoOp(GLfloat); void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationNoOp(GLfloat);
#ifndef MAGNUM_TARGET_GLES void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationArbOrExt(GLfloat anisotropy);
void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationArb(GLfloat anisotropy);
#endif
void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationExt(GLfloat anisotropy);
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void MAGNUM_GL_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); void MAGNUM_GL_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values);

4
src/Magnum/GL/Implementation/TextureState.cpp

@ -432,14 +432,14 @@ TextureState::TextureState(Context& context, Containers::StaticArrayView<Impleme
extensions[Extensions::ARB::texture_filter_anisotropic::Index] = extensions[Extensions::ARB::texture_filter_anisotropic::Index] =
Extensions::ARB::texture_filter_anisotropic::string(); Extensions::ARB::texture_filter_anisotropic::string();
setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationArb; setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationArbOrExt;
} else } else
#endif #endif
if(context.isExtensionSupported<Extensions::EXT::texture_filter_anisotropic>()) { if(context.isExtensionSupported<Extensions::EXT::texture_filter_anisotropic>()) {
extensions[Extensions::EXT::texture_filter_anisotropic::Index] = extensions[Extensions::EXT::texture_filter_anisotropic::Index] =
Extensions::EXT::texture_filter_anisotropic::string(); Extensions::EXT::texture_filter_anisotropic::string();
setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationExt; setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationArbOrExt;
} else setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationNoOp; } else setMaxAnisotropyImplementation = &AbstractTexture::setMaxAnisotropyImplementationNoOp;
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES

Loading…
Cancel
Save