summaryrefslogtreecommitdiff
path: root/src/mesa/main/depth.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2000-10-30 13:31:59 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2000-10-30 13:31:59 +0000
commita96308c37db0bc0086a017d318bc3504aa5f0b1a (patch)
tree0010de3aa19901acf13b57e57e7ba465abffa95e /src/mesa/main/depth.c
parenta4575499679d9d91055a35c7673b81872ec127cb (diff)
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.
Diffstat (limited to 'src/mesa/main/depth.c')
-rw-r--r--src/mesa/main/depth.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index c5e113e4e7..a5d9c34efc 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" );
}
}