dri: Remove driver GenerateMipmap hooks.
authorEric Anholt <eric@anholt.net>
Fri, 14 Oct 2011 21:11:17 +0000 (14:11 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 28 Oct 2011 18:31:11 +0000 (11:31 -0700)
Mesa sets up _mesa_meta_GenerateMipmap as the default hook, which does
this check for fallback and call the fallback itself.

src/mesa/drivers/dri/intel/intel_tex.c
src/mesa/drivers/dri/nouveau/nouveau_texture.c
src/mesa/drivers/dri/radeon/radeon_texture.c
src/mesa/drivers/dri/radeon/radeon_texture.h

index 7af513880916de72cb932d57a2344213690d8a15..05b0748bc3c3b08c9add906ebb6394f5cfdc2958 100644 (file)
@@ -224,32 +224,9 @@ intel_unmap_texture_image(struct gl_context *ctx,
    }
 }
 
-/**
- * Called via ctx->Driver.GenerateMipmap()
- * This is basically a wrapper for _mesa_meta_GenerateMipmap() which checks
- * if we'll be using software mipmap generation.  In that case, we need to
- * map/unmap the base level texture image.
- */
-static void
-intelGenerateMipmap(struct gl_context *ctx, GLenum target,
-                    struct gl_texture_object *texObj)
-{
-   if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) {
-      fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
-
-      _mesa_generate_mipmap(ctx, target, texObj);
-   }
-   else {
-      _mesa_meta_GenerateMipmap(ctx, target, texObj);
-   }
-}
-
-
 void
 intelInitTextureFuncs(struct dd_function_table *functions)
 {
-   functions->GenerateMipmap = intelGenerateMipmap;
-
    functions->NewTextureObject = intelNewTextureObject;
    functions->NewTextureImage = intelNewTextureImage;
    functions->DeleteTextureImage = intelDeleteTextureImage;
index 08ec03ee6c38e1a7c3c9731df69512daebfb48d0..8dd2df47f7f98a3d0652513a3c4bc5d2d981cb0d 100644 (file)
@@ -710,17 +710,6 @@ nouveau_texture_unmap(struct gl_context *ctx, struct gl_texture_object *t)
        }
 }
 
-static void
-nouveau_generate_mipmap(struct gl_context *ctx, GLenum target,
-                       struct gl_texture_object *t)
-{
-       if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, t)) {
-               _mesa_generate_mipmap(ctx, target, t);
-       } else {
-               _mesa_meta_GenerateMipmap(ctx, target, t);
-       }
-}
-
 void
 nouveau_texture_functions_init(struct dd_function_table *functions)
 {
@@ -740,5 +729,4 @@ nouveau_texture_functions_init(struct dd_function_table *functions)
        functions->UnmapTexture = nouveau_texture_unmap;
        functions->MapTextureImage = nouveau_map_texture_image;
        functions->UnmapTextureImage = nouveau_unmap_texture_image;
-       functions->GenerateMipmap = nouveau_generate_mipmap;
 }
index 45c49e4755bdf1d31e789ab8b2e115dc79a5f665..d84004527bba1a80818d1796ba69da13242334c2 100644 (file)
@@ -332,35 +332,6 @@ radeon_unmap_texture_image(struct gl_context *ctx,
                radeon_bo_unmap(image->mt->bo);
 }
 
-void radeonGenerateMipmap(struct gl_context* ctx, GLenum target, struct gl_texture_object *texObj)
-{
-       radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
-       struct radeon_bo *bo;
-       GLuint face = _mesa_tex_target_to_face(target);
-       radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]);
-       bo = !baseimage->mt ? baseimage->bo : baseimage->mt->bo;
-
-       radeon_print(RADEON_TEXTURE, RADEON_TRACE,
-               "%s(%p, target %s, tex %p)\n",
-               __func__, ctx, _mesa_lookup_enum_by_nr(target),
-               texObj);
-
-       if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) {
-               radeon_print(RADEON_TEXTURE, RADEON_NORMAL,
-                       "%s(%p, tex %p) Trying to generate mipmap for texture "
-                       "in processing by GPU.\n",
-                       __func__, ctx, texObj);
-               radeon_firevertices(rmesa);
-       }
-
-       if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) {
-               _mesa_generate_mipmap(ctx, target, texObj);
-       } else {
-               _mesa_meta_GenerateMipmap(ctx, target, texObj);
-       }
-}
-
-
 /* try to find a format which will only need a memcopy */
 static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
                                           GLenum srcFormat,
@@ -1124,8 +1095,6 @@ radeon_init_common_texture_funcs(radeonContextPtr radeon,
        functions->CompressedTexImage2D = radeonCompressedTexImage2D;
        functions->CompressedTexSubImage2D = radeonCompressedTexSubImage2D;
 
-       functions->GenerateMipmap = radeonGenerateMipmap;
-
        functions->CopyTexSubImage2D = radeonCopyTexSubImage2D;
 
 #if FEATURE_OES_EGL_image
index c68228b3728099ca102c06de7ccad2673453b553..41763aae0a484b74ca9f39fd0217d7a4ac2e2fa4 100644 (file)
@@ -43,7 +43,6 @@ void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable);
 void radeon_teximage_unmap(radeon_texture_image *image);
 void radeonMapTexture(struct gl_context *ctx, struct gl_texture_object *texObj);
 void radeonUnmapTexture(struct gl_context *ctx, struct gl_texture_object *texObj);
-void radeonGenerateMipmap(struct gl_context* ctx, GLenum target, struct gl_texture_object *texObj);
 int radeon_validate_texture_miptree(struct gl_context * ctx, struct gl_texture_object *texObj);
 
 gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,