summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kuehling <fxkuehl@gmx.de>2004-01-26 23:38:12 +0000
committerFelix Kuehling <fxkuehl@gmx.de>2004-01-26 23:38:12 +0000
commit8135a445f3b0ae207ec5e4485b5936050d438320 (patch)
treee0c63e4985bd670b34686ca5733d99364c9a1a12
parentef167c63282bb9b98492f46f9a3ad8f861db1a30 (diff)
downloadexternal_mesa3d-8135a445f3b0ae207ec5e4485b5936050d438320.zip
external_mesa3d-8135a445f3b0ae207ec5e4485b5936050d438320.tar.gz
external_mesa3d-8135a445f3b0ae207ec5e4485b5936050d438320.tar.bz2
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.
-rw-r--r--src/mesa/drivers/dri/i810/i810context.c2
-rw-r--r--src/mesa/drivers/dri/i810/i810tex.c5
-rw-r--r--src/mesa/drivers/dri/i830/i830_context.c4
-rw-r--r--src/mesa/drivers/dri/i830/i830_tex.c6
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c4
-rw-r--r--src/mesa/drivers/dri/mga/mgatex.c9
-rw-r--r--src/mesa/drivers/dri/r128/r128_context.c4
-rw-r--r--src/mesa/drivers/dri/r128/r128_tex.c8
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c5
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_tex.c9
10 files changed, 15 insertions, 41 deletions
diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c
index 78698e8..f443ce0 100644
--- a/src/mesa/drivers/dri/i810/i810context.c
+++ b/src/mesa/drivers/dri/i810/i810context.c
@@ -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 );
diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c
index cd9ef15..220d901 100644
--- a/src/mesa/drivers/dri/i810/i810tex.c
+++ b/src/mesa/drivers/dri/i810/i810tex.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/i830/i830_context.c b/src/mesa/drivers/dri/i830/i830_context.c
index 74a7d77..0d6b2b7 100644
--- a/src/mesa/drivers/dri/i830/i830_context.c
+++ b/src/mesa/drivers/dri/i830/i830_context.c
@@ -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 );
diff --git a/src/mesa/drivers/dri/i830/i830_tex.c b/src/mesa/drivers/dri/i830/i830_tex.c
index 3399859..00b869a 100644
--- a/src/mesa/drivers/dri/i830/i830_tex.c
+++ b/src/mesa/drivers/dri/i830/i830_tex.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index a3eb758..169615d 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -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 );
diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c
index 2fef5b8..1b45c0f 100644
--- a/src/mesa/drivers/dri/mga/mgatex.c
+++ b/src/mesa/drivers/dri/mga/mgatex.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c
index 7bb3244..ea1c276 100644
--- a/src/mesa/drivers/dri/r128/r128_context.c
+++ b/src/mesa/drivers/dri/r128/r128_context.c
@@ -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;
diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c
index 373ff5c..d459b62 100644
--- a/src/mesa/drivers/dri/r128/r128_tex.c
+++ b/src/mesa/drivers/dri/r128/r128_tex.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 6e9cc5f..de197aa 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -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 );
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c
index 99aa4a4..78220c6 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex.c
@@ -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;
}