Mesa (master): intel: Align cubemap texture height to its padding requirements.

Eric Anholt anholt at kemper.freedesktop.org
Wed Aug 19 16:27:14 UTC 2009


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug 18 18:48:54 2009 -0700

intel: Align cubemap texture height to its padding requirements.

---

 src/mesa/drivers/dri/i965/brw_tex_layout.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index 1d2e953..5e4f7fd 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -194,6 +194,16 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
 	 }
 
       }
+      /* The 965's sampler lays cachelines out according to how accesses
+       * in the texture surfaces run, so they may be "vertical" through
+       * memory.  As a result, the docs say in Surface Padding Requirements:
+       * Sampling Engine Surfaces that two extra rows of padding are required.
+       * We don't know of similar requirements for pre-965, but given that
+       * those docs are silent on padding requirements in general, let's play
+       * it safe.
+       */
+      if (mt->target == GL_TEXTURE_CUBE_MAP)
+	 total_height += 2;
       break;
    }
 




More information about the mesa-commit mailing list