Mesa (master): dri: Remove driver GenerateMipmap hooks.

Eric Anholt anholt at kemper.freedesktop.org
Fri Oct 28 11:39:38 PDT 2011


Module: Mesa
Branch: master
Commit: bd51e8e4f473dd4fb4f99ed7898d771c64caca2d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bd51e8e4f473dd4fb4f99ed7898d771c64caca2d

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Oct 14 14:11:17 2011 -0700

dri: Remove driver GenerateMipmap hooks.

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         |   23 -----------------
 src/mesa/drivers/dri/nouveau/nouveau_texture.c |   12 ---------
 src/mesa/drivers/dri/radeon/radeon_texture.c   |   31 ------------------------
 src/mesa/drivers/dri/radeon/radeon_texture.h   |    1 -
 4 files changed, 0 insertions(+), 67 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 7af5138..05b0748 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -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;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index 08ec03e..8dd2df4 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -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;
 }
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 45c49e4..d840045 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -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
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h
index c68228b..41763aa 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.h
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.h
@@ -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,



More information about the mesa-commit mailing list