From 6ba6cc57e17aefb7db0201a1f3180ab55076eb48 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 27 Dec 2014 09:00:58 -1000 Subject: glamor: Just set the logic op to what we want at the start of all rendering. By dropping the unconditional logic op disable at the end of rendering, this fixes GL errors being thrown in GLES2 contexts (which don't have logic ops). On desktop, this also means a little less overhead per draw call from taking one less trip through the glEnable/glDisable switch statement of doom in Mesa. The exchange here is that we end up taking a trip through it in the XV, Render, and gradient-generation paths. If the glEnable() is actually costly, we should probably cache our logic op state in our screen, since there's no way the GL could make that switch statement as cheap as the caller caching it would be. v2: Don't forget to set the logic op in Xephyr's drawing. Signed-off-by: Eric Anholt Reviewed-by: Keith Packard --- glamor/glamor_spans.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'glamor/glamor_spans.c') diff --git a/glamor/glamor_spans.c b/glamor/glamor_spans.c index fe8c7dc0f..7138db5a0 100644 --- a/glamor/glamor_spans.c +++ b/glamor/glamor_spans.c @@ -68,7 +68,7 @@ glamor_fill_spans_gl(DrawablePtr drawable, &glamor_facet_fillspans_130); if (!prog) - goto bail_ctx; + goto bail; /* Set up the vertex buffers for the points */ @@ -93,7 +93,7 @@ glamor_fill_spans_gl(DrawablePtr drawable, &glamor_facet_fillspans_120); if (!prog) - goto bail_ctx; + goto bail; /* Set up the vertex buffers for the points */ @@ -147,14 +147,11 @@ glamor_fill_spans_gl(DrawablePtr drawable, } glDisable(GL_SCISSOR_TEST); - glDisable(GL_COLOR_LOGIC_OP); if (glamor_priv->glsl_version >= 130) glVertexAttribDivisor(GLAMOR_VERTEX_POS, 0); glDisableVertexAttribArray(GLAMOR_VERTEX_POS); return TRUE; -bail_ctx: - glDisable(GL_COLOR_LOGIC_OP); bail: return FALSE; } -- cgit v1.2.3