[Mesa-dev] [PATCH] intel: Remove intel_mipmap_tree::wraps_etc
Anuj Phogat
anuj.phogat at gmail.com
Wed Feb 27 15:17:25 PST 2013
On Wed, Feb 27, 2013 at 1:31 PM, Chad Versace
<chad.versace at linux.intel.com> wrote:
> 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.
>
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
> src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 10 +++-------
> src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 14 --------------
> 2 files changed, 3 insertions(+), 21 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
> index 306cbbe..e150501 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 27540bc..2070be7 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;
> --
> 1.8.1.4
>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
More information about the mesa-dev
mailing list