diff options
author | Keith Whitwell <[email protected]> | 1999-09-10 14:24:35 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 1999-09-10 14:24:35 +0000 |
commit | 6c8657fa5f64044783dc22c20e7b89f188c877eb (patch) | |
tree | 623e12db1b1a8aa8043f59673ed248bcdf2e674c /src/mesa/main/depth.c | |
parent | f0f3815e4f93a72de339f9da7109b069dd6c90cd (diff) |
new DD_Z_NEVER flag
Diffstat (limited to 'src/mesa/main/depth.c')
-rw-r--r-- | src/mesa/main/depth.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index 6d5a2be237e..7ac2be01da0 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -1,4 +1,4 @@ -/* $Id: depth.c,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ +/* $Id: depth.c,v 1.2 1999/09/10 14:24:35 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -71,9 +71,7 @@ void gl_DepthFunc( GLcontext* ctx, GLenum func ) if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) fprintf(stderr, "glDepthFunc %s\n", gl_lookup_enum_by_nr(func)); - switch (func) { - case GL_NEVER: case GL_LESS: /* (default) pass if incoming z < stored z */ case GL_GEQUAL: case GL_LEQUAL: @@ -84,6 +82,17 @@ void gl_DepthFunc( GLcontext* ctx, GLenum func ) if (ctx->Depth.Func != func) { ctx->Depth.Func = func; ctx->NewState |= NEW_RASTER_OPS; + ctx->TriangleCaps &= ~DD_Z_NEVER; + if (ctx->Driver.DepthFunc) { + (*ctx->Driver.DepthFunc)( ctx, func ); + } + } + break; + case GL_NEVER: + if (ctx->Depth.Func != func) { + ctx->Depth.Func = func; + ctx->NewState |= NEW_RASTER_OPS; + ctx->TriangleCaps |= DD_Z_NEVER; if (ctx->Driver.DepthFunc) { (*ctx->Driver.DepthFunc)( ctx, func ); } |