summaryrefslogtreecommitdiff
path: root/src/mesa/main/texobj.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/texobj.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/texobj.c')
-rw-r--r--src/mesa/main/texobj.c28
1 files changed, 7 insertions, 21 deletions
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;
}