diff options
author | Brian Paul <[email protected]> | 2011-08-01 23:04:12 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2011-10-03 13:29:30 -0700 |
commit | e0304180c32227342dbb67b707bfae446543bb48 (patch) | |
tree | 05224697ca0948eded9adb328a215bc2c5a3a24f /src/mesa/drivers/dri/intel | |
parent | 1165b64f561a7bdd3f603d9e30a2340774ba31ee (diff) |
mesa: Convert _mesa_generate_mipmap to MapTexImage()-based access.
Now that we can zero-copy generate the mipmaps into brand new
glTexImage()-generated storage using MapTextureImage(), we no longer
need to allocate image->Data in mipmap generate. This requires
deleting the drivers' old overrides of the miptree tracking after
calling _mesa_generate_mipmap at the same time, or the drivers
promptly lose our newly-generated data.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex.c | 30 |
1 files changed, 1 insertions, 29 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); |