{
driTextureObject * t = (driTextureObject *) texObj->DriverData;
- assert(t);
if ( t ) {
driSwapOutTextureObject( t );
}
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:
_mesa_lookup_enum_by_nr( pname ) );
}
- if ( ( target != GL_TEXTURE_2D ) &&
- ( target != GL_TEXTURE_1D ) )
- return;
-
switch ( pname ) {
case GL_TEXTURE_MIN_FILTER:
case GL_TEXTURE_MAG_FILTER:
}
-#if 00
-/* not needed anymore */
static void radeonBindTexture( GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj )
{
ctx->Texture.CurrentUnit );
}
- if ( target == GL_TEXTURE_2D || target == GL_TEXTURE_1D ) {
- if ( texObj->DriverData == NULL ) {
- radeonAllocTexObj( texObj );
- }
- }
+ assert( (target != GL_TEXTURE_1D && target != GL_TEXTURE_2D &&
+ target != GL_TEXTURE_RECTANGLE_NV) ||
+ (texObj->DriverData != NULL) );
}
-#endif
+
static void radeonDeleteTexture( GLcontext *ctx,
struct gl_texture_object *texObj )
_mesa_lookup_enum_by_nr( texObj->Target ) );
}
- assert(t);
if ( t != NULL ) {
if ( rmesa ) {
RADEON_FIREVERTICES( rmesa );
/**
* 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;
- }
+ radeonAllocTexObj( obj );
return obj;
}
functions->TexSubImage2D = radeonTexSubImage2D;
functions->NewTextureObject = radeonNewTextureObject;
- /*functions->BindTexture = radeonBindTexture;*/
+ functions->BindTexture = radeonBindTexture;
functions->DeleteTexture = radeonDeleteTexture;
functions->IsTextureResident = driIsTextureResident;