From: Chad Versace Date: Fri, 15 Feb 2013 20:58:03 +0000 (-0800) Subject: intel: Remove intel_mipmap_tree::wraps_etc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=809fdc211fbe8fb7e2a8f024a7ad1a38948be0d0;p=mesa.git intel: Remove intel_mipmap_tree::wraps_etc The field was equivalent to (etc_format != MESA_FORMAT_NONE), and therefore duplicate information. This patch removes field and replaces all references to it with `etc_format != MESA_FORMAT_NONE`. No Piglit ETC test regresses on Intel Sandybridge. Reviewed-by: Kenneth Graunke Reviewed-by: Anuj Phogat Signed-off-by: Chad Versace --- diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 306cbbea177..e15050112ed 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -390,7 +390,6 @@ intel_miptree_create(struct intel_context *intel, total_height = ALIGN(total_height, 64); } - mt->wraps_etc = (etc_format != MESA_FORMAT_NONE) ? true : false; mt->etc_format = etc_format; mt->region = intel_region_alloc(intel->intelScreen, tiling, @@ -1309,10 +1308,7 @@ intel_miptree_map_etc(struct intel_context *intel, unsigned int level, unsigned int slice) { - /* For justification see intel_mipmap_tree:wraps_etc. - */ - assert(mt->wraps_etc); - + assert(mt->etc_format != MESA_FORMAT_NONE); if (mt->etc_format == MESA_FORMAT_ETC1_RGB8) { assert(mt->format == MESA_FORMAT_RGBX8888_REV); } @@ -1575,7 +1571,7 @@ intel_miptree_map_singlesample(struct intel_context *intel, if (mt->format == MESA_FORMAT_S8) { intel_miptree_map_s8(intel, mt, map, level, slice); - } else if (mt->wraps_etc) { + } else if (mt->etc_format != MESA_FORMAT_NONE) { intel_miptree_map_etc(intel, mt, map, level, slice); } else if (mt->stencil_mt) { intel_miptree_map_depthstencil(intel, mt, map, level, slice); @@ -1633,7 +1629,7 @@ intel_miptree_unmap_singlesample(struct intel_context *intel, if (mt->format == MESA_FORMAT_S8) { intel_miptree_unmap_s8(intel, mt, map, level, slice); - } else if (mt->wraps_etc) { + } else if (mt->etc_format != MESA_FORMAT_NONE) { intel_miptree_unmap_etc(intel, mt, map, level, slice); } else if (mt->stencil_mt) { intel_miptree_unmap_depthstencil(intel, mt, map, level, slice); diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index 27540bc182f..2070be7680a 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -360,20 +360,6 @@ struct intel_mipmap_tree */ struct intel_mipmap_tree *mcs_mt; - /** - * \brief The miptree contains uncompressed data that was originally - * ETC1/ETC2 data. - * - * On hardware that lacks support for ETC1/ETC2 textures, we do the following - * on calls to glCompressedTexImage2D() with an ETC1/ETC2 texture format: - * 1. Create a miptree whose format is a suitable uncompressed mesa format - * with the wraps_etc flag set. - * 2. Translate the ETC1/ETC2 data into uncompressed mesa format. - * 3. Store the uncompressed data into the miptree and discard the ETC1/ETC2 - * data. - */ - bool wraps_etc; - /* These are also refcounted: */ GLuint refcount;