mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
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>
This commit is contained in:
parent
4dd72fe70d
commit
56b2b3d385
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue