From 56b2b3d385170ab33934ec71fd9d0a6e0e1af9a8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 15 May 2015 12:12:04 -0600 Subject: mesa: move no-change glDepthFunc check earlier If the incoming func matches the current state it must be a legal value so we can do this before the switch statement. Signed-off-by: Brian Paul --- src/mesa/main/depth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index 29851ecb8a4..bb4591cf152 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -65,6 +65,9 @@ _mesa_DepthFunc( GLenum func ) if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func)); + if (ctx->Depth.Func == func) + return; + switch (func) { case GL_LESS: /* (default) pass if incoming z < stored z */ case GL_GEQUAL: @@ -80,9 +83,6 @@ _mesa_DepthFunc( GLenum func ) return; } - if (ctx->Depth.Func == func) - return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); ctx->Depth.Func = func; -- cgit v1.2.3