summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Wick <markus@selfnet.de>2014-05-14 23:08:17 +0200
committerEric Anholt <eric@anholt.net>2014-06-12 21:24:36 -0700
commit3778fab34bc00334edec4f845d0c6d43440f265a (patch)
tree6e3d36093e5fbe9d25ab958359265e8466df3e43
parente27a839bf0488d5b1cc2e2a887f2ea0e3d790790 (diff)
glamor: Fix no-mipmap allocations
With GL_TEXTURE_MIN_FILTER, we configure not to use mipmaps, but there's no real way until GL_ARB_texture_storage to dictate whether memory should be allocated for mipmap levels or not. GL_TEXTURE_MAX_LEVEL is a stronger hint to the driver than the filtering that we really don't want mipmap allocations. Stops VARM wasting warnings from the nvidia driver. Signed-off-by: Markus Wick <markus@selfnet.de> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--glamor/glamor_fbo.c1
-rw-r--r--glamor/glamor_font.c1
-rw-r--r--glamor/glamor_pixmap.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index 552168381..090dfd8e7 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -347,6 +347,7 @@ _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);
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 f747d59a1..57c607dc2 100644
--- a/glamor/glamor_font.c
+++ b/glamor/glamor_font.c
@@ -95,6 +95,7 @@ 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);
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 54b414bc2..789d3772e 100644
--- a/glamor/glamor_pixmap.c
+++ b/glamor/glamor_pixmap.c
@@ -717,6 +717,7 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex,
}
glBindTexture(GL_TEXTURE_2D, *tex);
+ 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);