[Mesa-dev] [PATCH 1/4] mesa: only check errors when the state change in glProvokingVertex()

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Jul 31 12:07:05 UTC 2017


When this GL call is a no-op, it should be a little faster.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/mesa/main/light.c | 6 +++---
 1 file 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;
 }
-- 
2.13.3



More information about the mesa-dev mailing list