Mesa (master): intel: Fix performance regression in Lightsmark since HiZ changes.

Eric Anholt anholt at kemper.freedesktop.org
Thu Dec 29 17:45:47 UTC 2011


Module: Mesa
Branch: master
Commit: 7f854a5028ef00a0e041e78a770456204dc58eef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7f854a5028ef00a0e041e78a770456204dc58eef

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Dec 16 13:18:55 2011 -0800

intel: Fix performance regression in Lightsmark since HiZ changes.

Since the refactor in d7b33309fe160212f2eb73f471f3aedcb5d0b5c1, depth
in the miptree changed from 1 to 6, so we always decided it didn't
match, and we would relayout to something that would still not
"match".

Improves performance 23.8% (+/- 1.1%, n=4)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43329

---

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

diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 9e0f201..9576489 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -345,6 +345,9 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
 
    intel_miptree_get_dimensions_for_image(image, &width, &height, &depth);
 
+   if (mt->target == GL_TEXTURE_CUBE_MAP)
+      depth = 6;
+
    /* Test image dimensions against the base level image adjusted for
     * minification.  This will also catch images not present in the
     * tree, changed targets, etc.




More information about the mesa-commit mailing list