[Mesa-dev] [PATCH 2/2] i965: Use proper texture alignment units for cubemaps on Gen5+.

Kenneth Graunke kenneth at whitecape.org
Mon Aug 15 12:21:07 PDT 2011


While align_h is normally 2, it isn't always.  In particular, for S3TC
textures, it needs to be 4.  intel_vertical_texture_alignment_unit
exists to implement the sundry rules surrounding alignment units, so we
ought to use it.

Fixes skybox errors in Quake 4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34628
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_tex_layout.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

This one fixes an actual bug.

diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index d868e9f..d9547f2 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -49,7 +49,8 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
    switch (mt->target) {
    case GL_TEXTURE_CUBE_MAP:
       if (intel->gen >= 5) {
-          GLuint align_h = 2;
+	  unsigned int align_h =
+	     intel_vertical_texture_alignment_unit(intel, mt->format);
           GLuint level;
           GLuint qpitch = 0;
 	  int h0, h1, q;
-- 
1.7.6



More information about the mesa-dev mailing list