summaryrefslogtreecommitdiff
path: root/glamor/glamor_spans.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-12-27 09:00:58 -1000
committerEric Anholt <eric@anholt.net>2015-03-24 12:43:34 -0700
commit6ba6cc57e17aefb7db0201a1f3180ab55076eb48 (patch)
tree3c09ed398b8e3bf751c918ea101fb0a68d8ece3b /glamor/glamor_spans.c
parent8102927282d5134493e5009a876a6b01a68d1f97 (diff)
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 <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor/glamor_spans.c')
-rw-r--r--glamor/glamor_spans.c7
1 files changed, 2 insertions, 5 deletions
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;
}