Mesa (9.0): i965: Fix validation of ETC miptrees.

Ian Romanick idr at kemper.freedesktop.org
Wed Jul 3 20:27:21 UTC 2013


Module: Mesa
Branch: 9.0
Commit: ba73bea5d057f44cd04f63ef3933551eb8052197
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba73bea5d057f44cd04f63ef3933551eb8052197

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Dec 18 12:03:49 2012 -0800

i965: Fix validation of ETC miptrees.

When comparing to the teximage's format, we have to look at the
format-the-mt-was-created-for not the format-actually-stored-in-the-mt.

Improves glbenchmark 2.1 offscreen test performance 159% +/- 17% (n=3).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54582
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
(cherry picked from commit 46386816a77c6e5751a0685776c0a6320f46f8fe)

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>

The original patch needed some backporting for the old tree.

---

 src/mesa/drivers/dri/intel/intel_mipmap_tree.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 556a82f..3b6f072 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -573,12 +573,14 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
    if (target_to_target(image->TexObject->Target) != mt->target)
       return false;
 
-   if (image->TexFormat != mt->format &&
-       !(image->TexFormat == MESA_FORMAT_S8_Z24 &&
-	 mt->format == MESA_FORMAT_X8_Z24 &&
-	 mt->stencil_mt)) {
+   gl_format mt_format = mt->format;
+   if (mt->format == MESA_FORMAT_X8_Z24 && mt->stencil_mt)
+      mt_format = MESA_FORMAT_S8_Z24;
+   if (mt->wraps_etc1)
+      mt_format = MESA_FORMAT_RGBX8888_REV;
+
+   if (image->TexFormat != mt_format)
       return false;
-   }
 
    intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);
 




More information about the mesa-commit mailing list