Make the R200 driver work with the NewTextureObject in Mesa. Other
authorIan Romanick <idr@us.ibm.com>
Wed, 21 Jan 2004 16:42:30 +0000 (16:42 +0000)
committerIan Romanick <idr@us.ibm.com>
Wed, 21 Jan 2004 16:42:30 +0000 (16:42 +0000)
drivers that use the texmem interface will likely need similar changes.

src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r200/r200_tex.c

index f8ab8d3697243ff2474b708a7ee42a8bc452c30f..cab967d9db398ae47f7bb23b1db367c854fbaef8 100644 (file)
@@ -414,11 +414,6 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
    r200InitState( rmesa );
    r200InitSwtcl( ctx );
 
-   /* used to be in r200InitTextureFuncs() */
-   driInitTextureObjects( ctx, & rmesa->swapped,
-                         DRI_TEXMGR_DO_TEXTURE_1D
-                         | DRI_TEXMGR_DO_TEXTURE_2D );
-
    fthrottle_mode = driQueryOptioni(&rmesa->optionCache, "fthrottle_mode");
    rmesa->iw.irq_seq = -1;
    rmesa->irqsEmitted = 0;
index c1c535507fe448bb997d13933a33ca56b1a5152d..a644b2ad3521f7f9bae868ee469505cf5c8c56fc 100644 (file)
@@ -941,10 +941,14 @@ static void r200BindTexture( GLcontext *ctx, GLenum target,
               ctx->Texture.CurrentUnit );
    }
 
-   if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) {
-      if ( texObj->DriverData == NULL ) {
-        r200AllocTexObj( texObj );
-      }
+   if ( (target == GL_TEXTURE_1D)
+       || (target == GL_TEXTURE_2D) 
+#if ENABLE_HW_3D_TEXTURE
+       || (target == GL_TEXTURE_3D)
+#endif
+       || (target == GL_TEXTURE_CUBE_MAP)
+       || (target == GL_TEXTURE_RECTANGLE_NV) ) {
+      assert( texObj->DriverData != NULL );
    }
 }
 
@@ -1012,6 +1016,7 @@ r200NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
    if (!obj)
       return NULL;
    obj->MaxAnisotropy = rmesa->initialMaxAnisotropy;
+   r200AllocTexObj( obj );
    return obj;
 }