summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-06-23 13:50:54 -0700
committerKeith Packard <keithp@keithp.com>2014-06-23 13:50:54 -0700
commitea47341792cf06eda5bbdf0aca48aacc024a5be0 (patch)
tree03ce8fff7a5b567d46a22a61aaeade993f24e874
parent334faabe682a422075ba214501c7554dd5ee5563 (diff)
parenta11bbd875f3f90a3d02d727778cb1d3524cf59fd (diff)
Merge remote-tracking branch 'anholt/glamor-fixes'
-rw-r--r--glamor/glamor.c5
-rw-r--r--glamor/glamor_fbo.c1
-rw-r--r--glamor/glamor_font.c1
-rw-r--r--glamor/glamor_image.c3
-rw-r--r--glamor/glamor_pixmap.c1
5 files changed, 8 insertions, 3 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 08f6ba174..c398807f1 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -316,6 +316,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
{
glamor_screen_private *glamor_priv;
int gl_version;
+ int max_viewport_size;
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
@@ -406,7 +407,9 @@ glamor_init(ScreenPtr screen, unsigned int flags)
epoxy_has_gl_extension("GL_ARB_map_buffer_range");
glamor_priv->has_buffer_storage =
epoxy_has_gl_extension("GL_ARB_buffer_storage");
- glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glamor_priv->max_fbo_size);
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &glamor_priv->max_fbo_size);
+ glGetIntegerv(GL_MAX_VIEWPORT_DIMS, &max_viewport_size);
+ glamor_priv->max_fbo_size = MIN(glamor_priv->max_fbo_size, max_viewport_size);
#ifdef MAX_FBO_SIZE
glamor_priv->max_fbo_size = MAX_FBO_SIZE;
#endif
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_image.c b/glamor/glamor_image.c
index 4791d089f..b38b41212 100644
--- a/glamor/glamor_image.c
+++ b/glamor/glamor_image.c
@@ -88,8 +88,7 @@ static void
glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
int w, int h, int leftPad, int format, char *bits)
{
- if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW) &&
- glamor_prepare_access_gc(gc))
+ if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW))
fbPutImage(drawable, gc, depth, x, y, w, h, leftPad, format, bits);
glamor_finish_access(drawable);
}
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);