summaryrefslogtreecommitdiff
path: root/src/mesa/main/buffers.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/buffers.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/buffers.c')
-rw-r--r--src/mesa/main/buffers.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 7d6528291b..33e7bc0016 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,4 +1,4 @@
-/* $Id: buffers.c,v 1.15 2000/10/28 18:34:48 brianp Exp $ */
+/* $Id: buffers.c,v 1.16 2000/10/30 13:31:59 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -51,6 +51,8 @@ _mesa_ClearIndex( GLfloat c )
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearIndex");
ctx->Color.ClearIndex = (GLuint) c;
+ ctx->NewState |= _NEW_COLOR;
+
if (!ctx->Visual.RGBAflag) {
/* it's OK to call glClearIndex in RGBA mode but it should be a NOP */
(*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex );
@@ -70,6 +72,7 @@ _mesa_ClearColor( GLclampf red, GLclampf green,
ctx->Color.ClearColor[1] = CLAMP( green, 0.0F, 1.0F );
ctx->Color.ClearColor[2] = CLAMP( blue, 0.0F, 1.0F );
ctx->Color.ClearColor[3] = CLAMP( alpha, 0.0F, 1.0F );
+ ctx->NewState |= _NEW_COLOR;
if (ctx->Visual.RGBAflag) {
GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
@@ -469,7 +472,7 @@ _mesa_DrawBuffer( GLenum mode )
}
ctx->Color.DrawBuffer = mode;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_COLOR;
}
@@ -527,7 +530,7 @@ _mesa_ReadBuffer( GLenum mode )
}
ctx->Pixel.ReadBuffer = mode;
- ctx->NewState |= NEW_RASTER_OPS;
+ ctx->NewState |= _NEW_PIXEL;
}
@@ -552,7 +555,7 @@ _mesa_ResizeBuffersMESA( void )
ctx->DrawBuffer->Height == (GLint) buf_height)
return;
- ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */
+ ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
/* save buffer size */
ctx->DrawBuffer->Width = buf_width;