diff options
author | Brian Paul <[email protected]> | 2004-01-20 15:24:50 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-01-20 15:24:50 +0000 |
commit | 4e713913fb88bc221eea1a18822cc782ca39af4d (patch) | |
tree | 71607e8e178163d5e8b79df15582cce89c6728cd /src/mesa/drivers/dri/radeon | |
parent | d4636e74c86fad221c57a3a1704106e2367fc230 (diff) |
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).
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_tex.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index ca6acba16af..99aa4a458b5 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; |