summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-03-16 10:45:54 +1000
committerAdam Jackson <ajax@redhat.com>2016-03-29 16:42:30 -0400
commitfb8ddcf1cb0f47257370c3d6a895a5a41bea8dc0 (patch)
treed2d09dfec83d07d74b115cce5782585cf14f99c6
parent1bffe77769a9dce623e4a587ed3895ba003c257b (diff)
glamor: swizzle RED to 0 for alpha textures
I'm pretty sure Eric suspected this could cause a problem, and we couldn't find a test. Well loading feedly in firefox seems to trigger badness that this solves. bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94554 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Tested-by: Timo Aaltonen <tjaalton@ubuntu.com> (cherry picked from commit a288cf58a0dc0f965a6f964c76bb86bb1989d797)
-rw-r--r--glamor/glamor_fbo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index 5bfffe501..c6ba095c0 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -340,8 +340,10 @@ _glamor_create_tex(glamor_screen_private *glamor_priv,
glBindTexture(GL_TEXTURE_2D, tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- if (format == glamor_priv->one_channel_format && format == GL_RED)
+ if (format == glamor_priv->one_channel_format && format == GL_RED) {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_ZERO);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED);
+ }
glamor_priv->suppress_gl_out_of_memory_logging = true;
glTexImage2D(GL_TEXTURE_2D, 0, format, w, h, 0,
format, GL_UNSIGNED_BYTE, NULL);