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/texobj.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'src/mesa/main/texobj.c') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 62238ff6fd..d873351617 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.30 2000/10/29 18:23:16 brianp Exp $ */ +/* $Id: texobj.c,v 1.31 2000/10/30 13:32:01 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -485,6 +485,7 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *texName) ctx->Shared->DefaultD[d]->RefCount++; t->RefCount--; ASSERT( t->RefCount >= 0 ); + ctx->NewState |= _NEW_TEXTURE; } } } @@ -537,7 +538,7 @@ _mesa_BindTexture( GLenum target, GLuint texName ) oldTexObj = texUnit->CurrentD[3]; break; case GL_TEXTURE_CUBE_MAP_ARB: - if (ctx->Extensions.HaveTextureCubeMap) { + if (ctx->Extensions.ARB_texture_cube_map) { dim = 6; oldTexObj = texUnit->CurrentCubeMap; break; @@ -598,28 +599,11 @@ _mesa_BindTexture( GLenum target, GLuint texName ) */ texUnit->Current = texUnit->CurrentD[texUnit->CurrentDimension]; - /* Check if we may have to use a new triangle rasterizer */ - if ((ctx->IndirectTriangles & DD_SW_RASTERIZE) && - ( oldTexObj->WrapS != newTexObj->WrapS - || oldTexObj->WrapT != newTexObj->WrapT - || oldTexObj->WrapR != newTexObj->WrapR - || oldTexObj->MinFilter != newTexObj->MinFilter - || oldTexObj->MagFilter != newTexObj->MagFilter - || (oldTexObj->Image[0] && newTexObj->Image[0] && - (oldTexObj->Image[0]->Format!=newTexObj->Image[0]->Format)))) - { - ctx->NewState |= (NEW_RASTER_OPS | NEW_TEXTURING); - } - - if (oldTexObj->Complete != newTexObj->Complete) - ctx->NewState |= NEW_TEXTURING; + ctx->NewState |= _NEW_TEXTURE; /* Pass BindTexture call to device driver */ - if (ctx->Driver.BindTexture) { + if (ctx->Driver.BindTexture) (*ctx->Driver.BindTexture)( ctx, target, newTexObj ); - /* Make sure the Driver.UpdateState() function gets called! */ - ctx->NewState |= NEW_TEXTURING; - } if (oldTexObj->Name > 0) { /* never delete default (id=0) texture objects */ @@ -665,6 +649,8 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, } } } + + ctx->NewState |= _NEW_TEXTURE; } -- cgit v1.2.3