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/mga/mgatex.c | |
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/mga/mgatex.c')
-rw-r--r-- | src/mesa/drivers/dri/mga/mgatex.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index b64335f3034..2fef5b832a9 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -366,7 +366,6 @@ static void mgaTexImage2D( GLcontext *ctx, GLenum target, GLint level, { driTextureObject * t = (driTextureObject *) texObj->DriverData; - assert(t); if ( t != NULL ) { driSwapOutTextureObject( t ); } @@ -437,7 +436,6 @@ mgaTexParameter( GLcontext *ctx, GLenum target, * created with current state before it is used, so we don't have * to do anything now */ - assert(t); if ( (t == NULL) || (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_NV) ) { @@ -482,8 +480,6 @@ mgaTexParameter( GLcontext *ctx, GLenum target, } -#if 0 -/* no longer needed */ static void mgaBindTexture( GLcontext *ctx, GLenum target, struct gl_texture_object *tObj ) @@ -495,7 +491,6 @@ mgaBindTexture( GLcontext *ctx, GLenum target, } } } -#endif static void @@ -520,22 +515,14 @@ mgaDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) * Called via ctx->Driver.NewTextureObject. * Note: this function will be called during context creation to * allocate the default texture objects. - * Fixup MaxAnisotropy according to user preference. + * 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 * mgaNewTextureObject( GLcontext *ctx, GLuint name, GLenum target ) { - mgaContextPtr rmesa = MGA_CONTEXT(ctx); struct gl_texture_object *obj; - driTextureObject *t; obj = _mesa_new_texture_object(ctx, name, target); - if (!obj) - return NULL; - t = (driTextureObject *) mgaAllocTexObj( obj ); - if (!t) { - _mesa_delete_texture_object(ctx, obj); - return NULL; - } return obj; } @@ -546,10 +533,10 @@ mgaInitTextureFuncs( struct dd_function_table *functions ) functions->ChooseTextureFormat = mgaChooseTextureFormat; functions->TexImage2D = mgaTexImage2D; functions->TexSubImage2D = mgaTexSubImage2D; - /*ctx->Driver.BindTexture = mgaBindTexture;*/ + functions->BindTexture = mgaBindTexture; functions->NewTextureObject = mgaNewTextureObject; functions->DeleteTexture = mgaDeleteTexture; - functions->IsTextureResident = driIsTextureResident; + functions->IsTextureResident = driIsTextureResident; functions->TexEnv = mgaTexEnv; functions->TexParameter = mgaTexParameter; } |