From a96308c37db0bc0086a017d318bc3504aa5f0b1a Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 30 Oct 2000 13:31:59 +0000 Subject: Replace the flags Mesa was using for ctx->NewState with a new set based on the GL attribute groups. Introduced constants describing the circumstances under which some key derived values can change: _SWRAST_NEW_RASTERMASK -- ctx->RasterMask _SWRAST_NEW_TRIANGLE -- The software rasterizer's triangle function _DD_NEW_FEEDBACK -- the 'DD_FEEDBACK' bit in ctx->TriangleCaps These are helpful in deciding whether you need to recalculate state if your recalculation involves reference to a derived value. --- src/mesa/main/depth.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa/main/depth.c') diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index c5e113e4e73..a5d9c34efc7 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -1,4 +1,4 @@ -/* $Id: depth.c,v 1.20 2000/10/29 18:23:16 brianp Exp $ */ +/* $Id: depth.c,v 1.21 2000/10/30 13:32:00 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -54,6 +54,7 @@ _mesa_ClearDepth( GLclampd depth ) ctx->Depth.Clear = (GLfloat) CLAMP( depth, 0.0, 1.0 ); if (ctx->Driver.ClearDepth) (*ctx->Driver.ClearDepth)( ctx, ctx->Depth.Clear ); + ctx->NewState |= _NEW_DEPTH; } @@ -77,7 +78,7 @@ _mesa_DepthFunc( GLenum func ) case GL_ALWAYS: if (ctx->Depth.Func != func) { ctx->Depth.Func = func; - ctx->NewState |= NEW_RASTER_OPS; + ctx->NewState |= _NEW_DEPTH; ctx->TriangleCaps &= ~DD_Z_NEVER; if (ctx->Driver.DepthFunc) { (*ctx->Driver.DepthFunc)( ctx, func ); @@ -87,7 +88,7 @@ _mesa_DepthFunc( GLenum func ) case GL_NEVER: if (ctx->Depth.Func != func) { ctx->Depth.Func = func; - ctx->NewState |= NEW_RASTER_OPS; + ctx->NewState |= _NEW_DEPTH; ctx->TriangleCaps |= DD_Z_NEVER; if (ctx->Driver.DepthFunc) { (*ctx->Driver.DepthFunc)( ctx, func ); @@ -116,7 +117,7 @@ _mesa_DepthMask( GLboolean flag ) */ if (ctx->Depth.Mask != flag) { ctx->Depth.Mask = flag; - ctx->NewState |= NEW_RASTER_OPS; + ctx->NewState |= _NEW_DEPTH; if (ctx->Driver.DepthMask) { (*ctx->Driver.DepthMask)( ctx, flag ); } @@ -1598,7 +1599,7 @@ _mesa_alloc_depth_buffer( GLcontext *ctx ) if (!ctx->DrawBuffer->DepthBuffer) { /* out of memory */ ctx->Depth.Test = GL_FALSE; - ctx->NewState |= NEW_RASTER_OPS; + ctx->NewState |= _NEW_DEPTH; gl_error( ctx, GL_OUT_OF_MEMORY, "Couldn't allocate depth buffer" ); } } -- cgit v1.2.3