summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/depth.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-05-15 12:12:04 -0600
committerBrian Paul <brianp@vmware.com>2015-06-03 11:35:46 -0600
commit56b2b3d385170ab33934ec71fd9d0a6e0e1af9a8 (patch)
treeab756ad508bb235c1585602653db34c4976d5abc /src/mesa/main/depth.c
parent4dd72fe70d6800525302c734d161be411ed9f7e0 (diff)
downloadexternal_mesa3d-56b2b3d385170ab33934ec71fd9d0a6e0e1af9a8.zip
external_mesa3d-56b2b3d385170ab33934ec71fd9d0a6e0e1af9a8.tar.gz
external_mesa3d-56b2b3d385170ab33934ec71fd9d0a6e0e1af9a8.tar.bz2
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 <brianp@vmware.com>
Diffstat (limited to 'src/mesa/main/depth.c')
-rw-r--r--src/mesa/main/depth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index 29851ec..bb4591c 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;