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 <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
This commit is contained in:
Chad Versace
2013-02-15 12:58:03 -08:00
parent c001985cbf
commit 809fdc211f
2 changed files with 3 additions and 21 deletions
@@ -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);
@@ -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;