i965/blorp: Reduce alignment restrictions for stencil blits.
authorPaul Berry <stereotype441@gmail.com>
Wed, 29 Aug 2012 21:26:48 +0000 (14:26 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 28 Sep 2012 18:20:39 +0000 (11:20 -0700)
commit21e9850d5369f9757b5005df4c8af38668a3053b
treec56102edc1f249f8712d8902e0910124b6b45a5a
parent62bc4af0e18f76dd30a4d5ae6d45a365a1fa226f
i965/blorp: Reduce alignment restrictions for stencil blits.

Previously, we aligned all stencil blit operations to multiples of the
size of a tile, since stencil buffers use W-tiling, and blorp has to
approximate this by configuring the 3D pipeline for Y-tiling and
swizzling coordinates.

However, this was unnecessarily conservative; it turns out that the
differences between W-tiling and Y-tiling are confined to 32-byte
sub-tiles within the 4k tiling pattern; the layout of these 32-byte
sub-tiles within the larger 4k tile is the same (8 sub-tiles across by
16 sub-tiles down, in column-major order).  Therefore we only need to
align stencil blit operations to multiples of the sub-tile size.

Note: although the performance improvement of this change is probably
quite small, the fact that W-tiling and Y-tiling formats only differ
within 32-byte sub-tiles will be essential in a future patch to ensure
that stencil blits work correctly between parts of the miptree other
than level/layer 0.  Making this change provides handy documentation
(and validation) of this fact.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5fd67fac14d7f35c311eb5c671be8d4ae9b2ea37)
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp