summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-01-20 15:24:50 +0000
committerBrian Paul <[email protected]>2004-01-20 15:24:50 +0000
commit4e713913fb88bc221eea1a18822cc782ca39af4d (patch)
tree71607e8e178163d5e8b79df15582cce89c6728cd /src/mesa/drivers/dri/r200
parentd4636e74c86fad221c57a3a1704106e2367fc230 (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/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_tex.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c
index 1990d661919..c1c535507fe 100644
--- a/src/mesa/drivers/dri/r200/r200_tex.c
+++ b/src/mesa/drivers/dri/r200/r200_tex.c
@@ -554,7 +554,6 @@ static void r200TexImage1D( GLcontext *ctx, GLenum target, GLint level,
{
driTextureObject * t = (driTextureObject *) texObj->DriverData;
- assert(t);
if ( t ) {
driSwapOutTextureObject( t );
}
@@ -617,8 +616,6 @@ static void r200TexImage2D( 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:
@@ -733,8 +730,6 @@ static void r200TexImage3D( GLcontext *ctx, GLenum target, GLint level,
{
driTextureObject * t = (driTextureObject *) texObj->DriverData;
- assert(t);
-
if ( t ) {
driSwapOutTextureObject( t );
}
@@ -938,8 +933,6 @@ static void r200TexParameter( GLcontext *ctx, GLenum target,
-#if 0
-/* not needed anymore */
static void r200BindTexture( GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj )
{
@@ -954,7 +947,6 @@ static void r200BindTexture( GLcontext *ctx, GLenum target,
}
}
}
-#endif
static void r200DeleteTexture( GLcontext *ctx,
@@ -1007,6 +999,8 @@ static void r200TexGen( GLcontext *ctx,
* Called via ctx->Driver.NewTextureObject.
* Note: this function will be called during context creation to
* allocate the default texture objects.
+ * 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.
* Fixup MaxAnisotropy according to user preference.
*/
static struct gl_texture_object *
@@ -1014,16 +1008,10 @@ r200NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
{
r200ContextPtr rmesa = R200_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 *) r200AllocTexObj( obj );
- if (!t) {
- _mesa_delete_texture_object(ctx, obj);
- return NULL;
- }
return obj;
}
@@ -1049,7 +1037,7 @@ void r200InitTextureFuncs( struct dd_function_table *functions )
functions->TexSubImage3D = _mesa_store_texsubimage3d;
#endif
functions->NewTextureObject = r200NewTextureObject;
- /*functions->BindTexture = r200BindTexture;*/
+ functions->BindTexture = r200BindTexture;
functions->DeleteTexture = r200DeleteTexture;
functions->IsTextureResident = driIsTextureResident;