Mesa (master): i965: Fix miptree matching for multisampled, non-interleaved miptrees.

Eric Anholt anholt at kemper.freedesktop.org
Fri Feb 21 18:44:37 UTC 2014


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Feb 18 15:14:30 2014 -0800

i965: Fix miptree matching for multisampled, non-interleaved miptrees.

We haven't been executing this code before the meta-blit case, because
we've been flagging the miptree as validated at texstorage time, and never
having to revalidate.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/intel_mipmap_tree.c |   15 ++++++++++++++-
 src/mesa/drivers/dri/i965/intel_mipmap_tree.h |    2 ++
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index eca876b..fb99edc 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -876,13 +876,26 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
    if (mt->target == GL_TEXTURE_CUBE_MAP)
       depth = 6;
 
+   int level_depth = mt->level[level].depth;
+   if (mt->num_samples > 1) {
+      switch (mt->msaa_layout) {
+      case INTEL_MSAA_LAYOUT_NONE:
+      case INTEL_MSAA_LAYOUT_IMS:
+         break;
+      case INTEL_MSAA_LAYOUT_UMS:
+      case INTEL_MSAA_LAYOUT_CMS:
+         level_depth /= mt->num_samples;
+         break;
+      }
+   }
+
    /* Test image dimensions against the base level image adjusted for
     * minification.  This will also catch images not present in the
     * tree, changed targets, etc.
     */
    if (width != minify(mt->logical_width0, level) ||
        height != minify(mt->logical_height0, level) ||
-       depth != mt->level[level].depth) {
+       depth != level_depth) {
       return false;
    }
 
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
index 6c45cfd..c274994 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
@@ -115,6 +115,8 @@ struct intel_mipmap_level
     *    - For GL_TEXTURE_3D, it is the texture's depth at this miplevel. Its
     *      value, like width and height, varies with miplevel.
     *    - For other texture types, depth is 1.
+    *    - Additionally, for UMS and CMS miptrees, depth is multiplied by
+    *      sample count.
     */
    GLuint depth;
 




More information about the mesa-commit mailing list