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/polygon.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mesa/main/polygon.c') diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index c96d3355b3..b4a7172dbd 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -1,4 +1,4 @@ -/* $Id: polygon.c,v 1.13 2000/10/21 00:02:47 brianp Exp $ */ +/* $Id: polygon.c,v 1.14 2000/10/30 13:32:01 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -55,7 +55,7 @@ _mesa_CullFace( GLenum mode ) } ctx->Polygon.CullFaceMode = mode; - ctx->NewState |= NEW_POLYGON; + ctx->NewState |= _NEW_POLYGON; if (ctx->Driver.CullFace) ctx->Driver.CullFace( ctx, mode ); @@ -79,7 +79,7 @@ _mesa_FrontFace( GLenum mode ) ctx->Polygon.FrontFace = mode; ctx->Polygon.FrontBit = (GLboolean) (mode == GL_CW); - ctx->NewState |= NEW_POLYGON; + ctx->NewState |= _NEW_POLYGON; if (ctx->Driver.FrontFace) ctx->Driver.FrontFace( ctx, mode ); @@ -123,7 +123,7 @@ _mesa_PolygonMode( GLenum face, GLenum mode ) ctx->TriangleCaps |= DD_TRI_UNFILLED; } - ctx->NewState |= (NEW_POLYGON | NEW_RASTER_OPS); + ctx->NewState |= _NEW_POLYGON; if (ctx->Driver.PolygonMode) { (*ctx->Driver.PolygonMode)( ctx, face, mode ); @@ -143,9 +143,7 @@ _mesa_PolygonStipple( const GLubyte *pattern ) _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack); - if (ctx->Polygon.StippleFlag) { - ctx->NewState |= NEW_RASTER_OPS; - } + ctx->NewState |= _NEW_POLYGONSTIPPLE; if (ctx->Driver.PolygonStipple) ctx->Driver.PolygonStipple( ctx, (const GLubyte *) ctx->PolygonStipple ); @@ -179,6 +177,7 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units ) ctx->Polygon.OffsetFactor = factor; ctx->Polygon.OffsetUnits = units; ctx->Polygon.OffsetMRD = units * ctx->Visual.MRD; + ctx->NewState |= _NEW_POLYGON; } -- cgit v1.2.3