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

Author: Kenneth Graunke <[email protected]>
Date:   Mon Aug 15 12:04:37 2011 -0700

i965: Use proper texture alignment units for cubemaps on Gen5+.

In particular, S3TC compressed textures need align_h == 4.

Fixes skybox errors in Quake 4 and FEAR.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34628
Signed-off-by: Kenneth Graunke <[email protected]>

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c 
b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index 46a417a..b5d2cf3 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -49,11 +49,14 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
    switch (mt->target) {
    case GL_TEXTURE_CUBE_MAP:
       if (intel->gen >= 5) {
-          GLuint align_h = 2;
+          GLuint align_w;
+          GLuint align_h;
           GLuint level;
           GLuint qpitch = 0;
          int h0, h1, q;
 
+         intel_get_texture_alignment_unit(mt->format, &align_w, &align_h);
+
          /* On Ironlake, cube maps are finally represented as just a series
           * of MIPLAYOUT_BELOW 2D textures (like 2D texture arrays), separated
           * by a pitch of qpitch rows, where qpitch is defined by the equation

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to