[mutter] cogl: Replace an outdated #ifdef
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cogl: Replace an outdated #ifdef
- Date: Wed, 13 May 2020 09:54:51 +0000 (UTC)
commit 73ce9c2e813e3ce7fb547bff598132eae3da4fba
Author: Daniel van Vugt <daniel van vugt canonical com>
Date: Tue Feb 11 17:08:12 2020 +0800
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
cogl/cogl/driver/gl/cogl-texture-gl.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/cogl/cogl/driver/gl/cogl-texture-gl.c b/cogl/cogl/driver/gl/cogl-texture-gl.c
index eb371709b..f365fc90b 100644
--- a/cogl/cogl/driver/gl/cogl-texture-gl.c
+++ b/cogl/cogl/driver/gl/cogl-texture-gl.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]