[PATCH 5/7] glamor: GL_TEXTURE_MAX_LEVEL is not available on GLES2

Maarten Lankhorst maarten.lankhorst at ubuntu.com
Mon Jan 12 06:29:35 PST 2015


Signed-off-by: Maarten Lankhorst <maarten.lankhorst at ubuntu.com>
---
 glamor/glamor_fbo.c    | 3 ++-
 glamor/glamor_font.c   | 3 ++-
 glamor/glamor_pixmap.c | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index d2aabb2..30f8342 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -348,7 +348,8 @@ _glamor_create_tex(glamor_screen_private *glamor_priv,
         glamor_make_current(glamor_priv);
         glGenTextures(1, &tex);
         glBindTexture(GL_TEXTURE_2D, tex);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+        if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP)
+            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
         glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
         glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0,
diff --git a/glamor/glamor_font.c b/glamor/glamor_font.c
index 0ca91fa..385d5f0 100644
--- a/glamor/glamor_font.c
+++ b/glamor/glamor_font.c
@@ -97,7 +97,8 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
     glActiveTexture(GL_TEXTURE0);
     glBindTexture(GL_TEXTURE_2D, glamor_font->texture_id);
 
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+    if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP)
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 
diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c
index 947113e..1c53ee1 100644
--- a/glamor/glamor_pixmap.c
+++ b/glamor/glamor_pixmap.c
@@ -717,7 +717,8 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex,
     }
 
     glBindTexture(GL_TEXTURE_2D, *tex);
-    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+    if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP)
+        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
     glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
-- 
2.2.1



More information about the xorg-devel mailing list