Make the drivers using the common texmem code work with NewTextureObject

in Mesa. This is analogous to changes idr made to the r200 driver. Patch
submitted by Andreas Stenglein.
This commit is contained in:
Felix Kuehling 2004-01-26 23:38:12 +00:00
parent ef167c6328
commit 8135a445f3
10 changed files with 15 additions and 41 deletions

View file

@ -292,8 +292,6 @@ i810CreateContext( const __GLcontextModes *mesaVis,
i810InitVB( ctx );
i810InitState( ctx );
driInitTextureObjects( ctx, &imesa->swapped, DRI_TEXMGR_DO_TEXTURE_2D);
#if DO_DEBUG
I810_DEBUG = driParseDebugString( getenv( "I810_DEBUG" ),
debug_control );

View file

@ -412,9 +412,7 @@ static void i810TexSubImage2D( GLcontext *ctx,
static void i810BindTexture( GLcontext *ctx, GLenum target,
struct gl_texture_object *tObj )
{
if (!tObj->DriverData) {
i810AllocTexObj( ctx, tObj );
}
assert( (target != GL_TEXTURE_2D) || (tObj->DriverData != NULL) );
}
@ -532,6 +530,7 @@ i810NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
{
struct gl_texture_object *obj;
obj = _mesa_new_texture_object(ctx, name, target);
i810AllocTexObj( ctx, obj );
return obj;
}

View file

@ -370,10 +370,6 @@ GLboolean i830CreateContext( const __GLcontextModes *mesaVis,
i830DDInitSpanFuncs( ctx );
i830DDInitState (ctx);
driInitTextureObjects( ctx, & imesa->swapped,
DRI_TEXMGR_DO_TEXTURE_2D
| DRI_TEXMGR_DO_TEXTURE_RECT );
#if DO_DEBUG
I830_DEBUG = driParseDebugString( getenv( "I830_DEBUG" ),
debug_control );

View file

@ -420,9 +420,8 @@ static void i830TexSubImage2D( GLcontext *ctx,
static void i830BindTexture( GLcontext *ctx, GLenum target,
struct gl_texture_object *tObj )
{
if (!tObj->DriverData) {
i830AllocTexObj( tObj );
}
assert( (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_NV) ||
(tObj->DriverData != NULL) );
}
@ -565,6 +564,7 @@ i830NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
{
struct gl_texture_object *obj;
obj = _mesa_new_texture_object(ctx, name, target);
i830AllocTexObj( obj );
return obj;
}

View file

@ -527,10 +527,6 @@ mgaCreateContext( const __GLcontextModes *mesaVis,
mgaDDInitPixelFuncs( ctx );
mgaDDInitTriFuncs( ctx );
driInitTextureObjects( ctx, & mmesa->swapped,
(DRI_TEXMGR_DO_TEXTURE_2D |
DRI_TEXMGR_DO_TEXTURE_RECT) );
mgaInitVB( ctx );
mgaInitState( mmesa );

View file

@ -484,12 +484,8 @@ static void
mgaBindTexture( GLcontext *ctx, GLenum target,
struct gl_texture_object *tObj )
{
if ( target == GL_TEXTURE_2D ||
target == GL_TEXTURE_RECTANGLE_NV ) {
if ( tObj->DriverData == NULL ) {
mgaAllocTexObj( tObj );
}
}
assert( (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_NV) ||
(tObj->DriverData != NULL) );
}
@ -523,6 +519,7 @@ mgaNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
{
struct gl_texture_object *obj;
obj = _mesa_new_texture_object(ctx, name, target);
mgaAllocTexObj( obj );
return obj;
}

View file

@ -245,10 +245,6 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual,
r128DDInitSpanFuncs( ctx );
r128DDInitState( rmesa );
driInitTextureObjects( ctx, & rmesa->swapped,
DRI_TEXMGR_DO_TEXTURE_1D
| DRI_TEXMGR_DO_TEXTURE_2D );
rmesa->vblank_flags = (rmesa->r128Screen->irq != 0)
? driGetDefaultVBlankFlags(&rmesa->optionCache) : VBLANK_FLAG_NO_IRQ;

View file

@ -561,11 +561,8 @@ static void r128BindTexture( GLcontext *ctx, GLenum target,
ctx->Texture.CurrentUnit );
}
if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) {
if ( tObj->DriverData == NULL ) {
r128AllocTexObj( tObj );
}
}
assert( (target != GL_TEXTURE_2D && target != GL_TEXTURE_1D) ||
(tObj->DriverData != NULL) );
}
@ -598,6 +595,7 @@ r128NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
{
struct gl_texture_object *obj;
obj = _mesa_new_texture_object(ctx, name, target);
r128AllocTexObj( obj );
return obj;
}

View file

@ -354,11 +354,6 @@ radeonCreateContext( const __GLcontextModes *glVisual,
rmesa->boxes = 0;
/* formerly in radeon_tex.c */
driInitTextureObjects( ctx, & rmesa->swapped,
DRI_TEXMGR_DO_TEXTURE_1D
| DRI_TEXMGR_DO_TEXTURE_2D );
/* Initialize the software rasterizer and helper modules.
*/
_swrast_CreateContext( ctx );

View file

@ -674,11 +674,9 @@ static void radeonBindTexture( GLcontext *ctx, GLenum target,
ctx->Texture.CurrentUnit );
}
if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) {
if ( texObj->DriverData == NULL ) {
radeonAllocTexObj( texObj );
}
}
assert( (target != GL_TEXTURE_1D && target != GL_TEXTURE_2D &&
target != GL_TEXTURE_RECTANGLE_NV) ||
(texObj->DriverData != NULL) );
}
@ -741,6 +739,7 @@ radeonNewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
if (!obj)
return NULL;
obj->MaxAnisotropy = rmesa->initialMaxAnisotropy;
radeonAllocTexObj( obj );
return obj;
}