summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-03-11 12:21:06 +0900
committerAdam Jackson <ajax@redhat.com>2016-03-11 10:32:22 -0500
commit316948734c2bba72d42c4cf4530932b5862c109f (patch)
treef9f651efca841fc52256b6986baacd46b9d390ab
parentef3005da3d5dc92b3ee5a0ee78164e739a3216dc (diff)
glamor: Make context current in glamor_pixmap_fbo_cache_put
Without this, we may be manipulating the context of another screen. In a system with two GPUs using glamor, this fixes lots of (EE) glamor256: GL error: GL_INVALID_OPERATION in glBindTexture(non-gen name) spew since 0b4c0c75 ('glamor: Replace "finish access" shader with texture swizzling'). Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--glamor/glamor_fbo.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
index d5311a909..a531f6052 100644
--- a/glamor/glamor_fbo.c
+++ b/glamor/glamor_fbo.c
@@ -174,6 +174,7 @@ glamor_pixmap_fbo_cache_put(glamor_screen_private *glamor_priv,
* glamor_picture.c. Don't reset GL_RED -> GL_ALPHA swizzle, though
*/
if (glamor_priv->has_texture_swizzle && n_format != 2) {
+ glamor_make_current(glamor_priv);
glBindTexture(GL_TEXTURE_2D, fbo->tex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN);