intel-gem: Fix y-tile swizzling for our G965 with swizzle_mode=1.
authorEric Anholt <eric@anholt.net>
Wed, 2 Jul 2008 17:21:44 +0000 (10:21 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 2 Jul 2008 17:21:44 +0000 (10:21 -0700)
Apparently in Y mode we get bit 6 ^ bit 9.  The reflect demo in 'd' mode now
displays correctly.

src/mesa/drivers/dri/intel/intel_span.c

index 6138b262f4753c3fcbe03f449c9cfccb814c8e34..7b079afa7363ad4eb4b8fca7dfbc9c57b1da8640 100644 (file)
@@ -183,6 +183,16 @@ static GLubyte *y_tile_swizzle(struct intel_renderbuffer *irb, struct intel_cont
 
        tile_off = ((x_tile_off & ~0xf) << 5) + (y_tile_off << 4) +
           (x_tile_off & 0xf);
+
+       switch (intel->tiling_swizzle_mode) {
+       case 0:
+          break;
+       case 1:
+          tile_off ^= (tile_off >> 3) & 64;
+          break;
+       case 2:
+          break;
+       }
        tile_base = (x_tile_number << 12) + y_tile_number * tile_stride;
 
        return buf + tile_base + tile_off;