From 4e713913fb88bc221eea1a18822cc782ca39af4d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Jan 2004 15:24:50 +0000 Subject: Undo some bits from last check-in related to the ctx->Driver.NewTextureObject functions. Don't allocate the driver-specific data during texture object creation but do it later as needed (as code originally was). --- src/mesa/drivers/dri/radeon/radeon_tex.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/mesa/drivers/dri/radeon') diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index ca6acba16a..99aa4a458b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -401,7 +401,6 @@ static void radeonTexImage1D( GLcontext *ctx, GLenum target, GLint level, { driTextureObject * t = (driTextureObject *) texObj->DriverData; - assert(t); if ( t ) { driSwapOutTextureObject( t ); } @@ -464,8 +463,6 @@ static void radeonTexImage2D( GLcontext *ctx, GLenum target, GLint level, driTextureObject * t = (driTextureObject *) texObj->DriverData; GLuint face; - assert(t); - /* which cube face or ordinary 2D image */ switch (target) { case GL_TEXTURE_CUBE_MAP_POSITIVE_X: @@ -669,8 +666,6 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target, } -#if 00 -/* not needed anymore */ static void radeonBindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *texObj ) { @@ -685,7 +680,7 @@ static void radeonBindTexture( GLcontext *ctx, GLenum target, } } } -#endif + static void radeonDeleteTexture( GLcontext *ctx, struct gl_texture_object *texObj ) @@ -734,22 +729,18 @@ static void radeonTexGen( GLcontext *ctx, /** * Allocate a new texture object. * Called via ctx->Driver.NewTextureObject. + * Note: we could use containment here to 'derive' the driver-specific + * texture object from the core mesa gl_texture_object. Not done at this time. */ static struct gl_texture_object * radeonNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); struct gl_texture_object *obj; - driTextureObject *t; obj = _mesa_new_texture_object(ctx, name, target); if (!obj) return NULL; obj->MaxAnisotropy = rmesa->initialMaxAnisotropy; - t = (driTextureObject *) radeonAllocTexObj(obj); - if (!t) { - _mesa_delete_texture_object(ctx, obj); - return NULL; - } return obj; } @@ -763,7 +754,7 @@ void radeonInitTextureFuncs( struct dd_function_table *functions ) functions->TexSubImage2D = radeonTexSubImage2D; functions->NewTextureObject = radeonNewTextureObject; - /*functions->BindTexture = radeonBindTexture;*/ + functions->BindTexture = radeonBindTexture; functions->DeleteTexture = radeonDeleteTexture; functions->IsTextureResident = driIsTextureResident; -- cgit v1.2.3