summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-07-31 14:07:05 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-07-31 19:08:44 +0200
commitc787477378e2f79e1ceef23286998f528e6d02f0 (patch)
treeece36b24e268a466dec8ee40de16c6ca5a286edc
parent6d37bcdb79f9cada7c67da833a21f6a5b9b0c18f (diff)
mesa: only check errors when the state change in glProvokingVertex()
When this GL call is a no-op, it should be a little faster. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-rw-r--r--src/mesa/main/light.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 245692a54c..f52ed8ed25 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -73,6 +73,9 @@ _mesa_ProvokingVertex(GLenum mode)
if (MESA_VERBOSE&VERBOSE_API)
_mesa_debug(ctx, "glProvokingVertexEXT 0x%x\n", mode);
+ if (ctx->Light.ProvokingVertex == mode)
+ return;
+
switch (mode) {
case GL_FIRST_VERTEX_CONVENTION_EXT:
case GL_LAST_VERTEX_CONVENTION_EXT:
@@ -82,9 +85,6 @@ _mesa_ProvokingVertex(GLenum mode)
return;
}
- if (ctx->Light.ProvokingVertex == mode)
- return;
-
FLUSH_VERTICES(ctx, _NEW_LIGHT);
ctx->Light.ProvokingVertex = mode;
}