summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.c30
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_texture.c10
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c50
3 files changed, 2 insertions, 88 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 55b3e349b4c..bc7b1f64b3e 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -163,37 +163,9 @@ intelGenerateMipmap(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj)
{
if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) {
- /* sw path: need to map texture images */
- struct intel_context *intel = intel_context(ctx);
- struct intel_texture_object *intelObj = intel_texture_object(texObj);
- struct gl_texture_image *first_image = texObj->Image[0][texObj->BaseLevel];
-
fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
- if (_mesa_is_format_compressed(first_image->TexFormat)) {
- _mesa_generate_mipmap(ctx, target, texObj);
- } else {
- intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel);
- _mesa_generate_mipmap(ctx, target, texObj);
- intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel);
- }
-
- if (!_mesa_is_format_compressed(first_image->TexFormat)) {
- GLuint nr_faces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- GLuint face, i;
- for (face = 0; face < nr_faces; face++) {
- for (i = texObj->BaseLevel + 1; i < texObj->MaxLevel; i++) {
- struct intel_texture_image *intelImage =
- intel_texture_image(texObj->Image[face][i]);
- if (!intelImage)
- break;
- /* Unreference the miptree to signal that the new Data is a
- * bare pointer from mesa.
- */
- intel_miptree_release(&intelImage->mt);
- }
- }
- }
+ _mesa_generate_mipmap(ctx, target, texObj);
}
else {
_mesa_meta_GenerateMipmap(ctx, target, texObj);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index 9dc21869ca8..508c8a59dbd 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -739,17 +739,7 @@ nouveau_generate_mipmap(struct gl_context *ctx, GLenum target,
{
if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, t)) {
struct gl_texture_image *base = t->Image[0][t->BaseLevel];
-
- nouveau_teximage_map(ctx, base, GL_MAP_READ_BIT,
- 0, 0, base->Width, base->Height);
_mesa_generate_mipmap(ctx, target, t);
- nouveau_teximage_unmap(ctx, base);
-
- if (!_mesa_is_format_compressed(base->TexFormat)) {
- store_mipmap(ctx, target, t->BaseLevel + 1,
- get_last_level(t), t);
- }
-
} else {
_mesa_meta_GenerateMipmap(ctx, target, t);
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 7f824ce2038..6bd89671083 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -324,52 +324,6 @@ radeon_unmap_texture_image(struct gl_context *ctx,
radeon_bo_unmap(image->mt->bo);
}
-/**
- * Wraps Mesa's implementation to ensure that the base level image is mapped.
- *
- * This relies on internal details of _mesa_generate_mipmap, in particular
- * the fact that the memory for recreated texture images is always freed.
- */
-static void radeon_generate_mipmap(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj)
-{
- radeonTexObj* t = radeon_tex_obj(texObj);
- GLuint nr_faces = (t->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
- int i, face;
- struct gl_texture_image *first_image;
-
- radeon_print(RADEON_TEXTURE, RADEON_VERBOSE,
- "%s(%p, tex %p) Target type %s.\n",
- __func__, ctx, texObj,
- _mesa_lookup_enum_by_nr(target));
-
- _mesa_generate_mipmap(ctx, target, texObj);
-
- /* For the compressed case, we don't need to do the
- * non-TexImage recovery path below.
- */
- first_image = texObj->Image[0][texObj->BaseLevel];
- if (_mesa_is_format_compressed(first_image->TexFormat))
- return;
-
- for (face = 0; face < nr_faces; face++) {
- for (i = texObj->BaseLevel + 1; i < texObj->MaxLevel; i++) {
- radeon_texture_image *image;
-
- image = get_radeon_texture_image(texObj->Image[face][i]);
-
- if (image == NULL)
- break;
-
- image->mtlevel = i;
- image->mtface = face;
-
- radeon_miptree_unreference(&image->mt);
- }
- }
-
-}
-
void radeonGenerateMipmap(struct gl_context* ctx, GLenum target, struct gl_texture_object *texObj)
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
@@ -392,9 +346,7 @@ void radeonGenerateMipmap(struct gl_context* ctx, GLenum target, struct gl_textu
}
if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) {
- radeon_teximage_map(baseimage, GL_FALSE);
- radeon_generate_mipmap(ctx, target, texObj);
- radeon_teximage_unmap(baseimage);
+ _mesa_generate_mipmap(ctx, target, texObj);
} else {
_mesa_meta_GenerateMipmap(ctx, target, texObj);
}