cogl: Replace an outdated #ifdef

The feature `GL_TEXTURE_MAX_LEVEL` it is hiding actually exists
in ES>=3.0, so the #ifdef is not appropriate.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1003
This commit is contained in:
Daniel van Vugt 2020-02-11 17:08:12 +08:00 committed by Jonas Ådahl
parent fd27c7c444
commit 73ce9c2e81

View File

@ -97,12 +97,19 @@ _cogl_texture_gl_flush_legacy_texobj_filters (CoglTexture *texture,
min_filter, mag_filter);
}
/* GL and GLES3 have this by default, but GLES2 does not except via extension.
* So really it's probably always available. Even if we used it and it wasn't
* available in some driver then there are no adverse consequences to the
* command simply being ignored...
*/
#ifndef GL_TEXTURE_MAX_LEVEL
#define GL_TEXTURE_MAX_LEVEL 0x813D
#endif
void
_cogl_texture_gl_maybe_update_max_level (CoglTexture *texture,
int max_level)
{
/* This isn't supported on GLES */
#ifdef HAVE_COGL_GL
CoglContext *ctx = texture->context;
if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_TEXTURE_MAX_LEVEL) &&
@ -121,7 +128,6 @@ _cogl_texture_gl_maybe_update_max_level (CoglTexture *texture,
GE( ctx, glTexParameteri (gl_target,
GL_TEXTURE_MAX_LEVEL, texture->max_level));
}
#endif /* HAVE_COGL_GL */
}
void