summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i810
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/i810
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/i810')
-rw-r--r--src/mesa/drivers/dri/i810/i810tex.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c
index bf404e36f0a..cd9ef153b7d 100644
--- a/src/mesa/drivers/dri/i810/i810tex.c
+++ b/src/mesa/drivers/dri/i810/i810tex.c
@@ -224,7 +224,8 @@ static void i810TexParameter( GLcontext *ctx, GLenum target,
i810ContextPtr imesa = I810_CONTEXT(ctx);
i810TextureObjectPtr t = (i810TextureObjectPtr) tObj->DriverData;
- assert(t);
+ if (!t)
+ return;
if ( target != GL_TEXTURE_2D )
return;
@@ -341,7 +342,6 @@ static void i810TexImage1D( GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage )
{
i810TextureObjectPtr t = (i810TextureObjectPtr) texObj->DriverData;
- assert(t);
if (t) {
i810SwapOutTexObj( imesa, t );
}
@@ -371,7 +371,6 @@ static void i810TexImage2D( GLcontext *ctx, GLenum target, GLint level,
struct gl_texture_image *texImage )
{
driTextureObject *t = (driTextureObject *) texObj->DriverData;
- assert(t);
if (t) {
I810_FIREVERTICES( I810_CONTEXT(ctx) );
driSwapOutTextureObject( t );
@@ -400,7 +399,6 @@ static void i810TexSubImage2D( GLcontext *ctx,
struct gl_texture_image *texImage )
{
driTextureObject *t = (driTextureObject *)texObj->DriverData;
- assert(t);
if (t) {
I810_FIREVERTICES( I810_CONTEXT(ctx) );
driSwapOutTextureObject( t );
@@ -411,17 +409,13 @@ static void i810TexSubImage2D( GLcontext *ctx,
}
-#if 0
-/* not needed anymore */
static void i810BindTexture( GLcontext *ctx, GLenum target,
struct gl_texture_object *tObj )
{
- assert(t);
if (!tObj->DriverData) {
i810AllocTexObj( ctx, tObj );
- }
+ }
}
-#endif
static void i810DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
@@ -530,20 +524,14 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
* 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.
*/
static struct gl_texture_object *
i810NewTextureObject( GLcontext *ctx, GLuint name, GLenum target )
{
struct gl_texture_object *obj;
- driTextureObject *t;
obj = _mesa_new_texture_object(ctx, name, target);
- if (!obj)
- return NULL;
- t = (driTextureObject *) i810AllocTexObj( ctx, obj );
- if (!t) {
- _mesa_delete_texture_object(ctx, obj);
- return NULL;
- }
return obj;
}
@@ -552,7 +540,7 @@ void i810InitTextureFuncs( struct dd_function_table *functions )
functions->ChooseTextureFormat = i810ChooseTextureFormat;
functions->TexImage2D = i810TexImage2D;
functions->TexSubImage2D = i810TexSubImage2D;
- /*functions->BindTexture = i810BindTexture;*/
+ functions->BindTexture = i810BindTexture;
functions->NewTextureObject = i810NewTextureObject;
functions->DeleteTexture = i810DeleteTexture;
functions->TexParameter = i810TexParameter;