r600g: hack around a problem with texture alignment
authorMarek Olšák <maraeo@gmail.com>
Fri, 19 Aug 2011 19:48:12 +0000 (21:48 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 19 Aug 2011 21:12:11 +0000 (23:12 +0200)
src/gallium/drivers/r600/r600_texture.c

index 74219e8005f28694219083093180f3d3a0e0e8fa..5681dd88e509d911c83ca765ab3ce33d4db1b04d 100644 (file)
@@ -198,6 +198,16 @@ static unsigned r600_texture_get_nblocksy(struct pipe_screen *screen,
        height = util_format_get_nblocksy(rtex->real_format, height);
        tile_height = r600_get_height_alignment(screen,
                                                rtex->array_mode[level]);
+
+       /* XXX Hack around an alignment issue. Less tests fail with this.
+        *
+        * The thing is depth-stencil buffers should be tiled, i.e.
+        * the alignment should be >=8. If I make them tiled, stencil starts
+        * working because it no longer overlaps with the depth buffer
+        * in memory, but texturing like drawpix-stencil breaks. */
+       if (util_format_is_depth_or_stencil(rtex->real_format) && tile_height < 8)
+               tile_height = 8;
+
        height = align(height, tile_height);
        return height;
 }