i965/blorp: don't reduce stencil alignment restrictions when multisampling.
authorPaul Berry <stereotype441@gmail.com>
Wed, 29 Aug 2012 22:11:49 +0000 (15:11 -0700)
committerPaul Berry <stereotype441@gmail.com>
Wed, 12 Sep 2012 21:44:13 +0000 (14:44 -0700)
commit1a75063d5f829547b75b60ae64bddf3905b4cb8f
treef79c692be8c7b85f360016d38697e4be4d081f15
parentb760c9913dcff848a2aa0e60abeb48e596ae8fee
i965/blorp: don't reduce stencil alignment restrictions when multisampling.

When blitting to a stencil buffer, we need to align the rectangle we
send down the rendering pipeline, to account for the fact that the
stencil buffer uses a W-tiled layout, but we are configuring its
surface state as Y-tiled.

Previously, when the stencil buffer was multisampled, we assumed that
we could reduce the amount of alignment that was necessary, since each
pixel occupies a block of 2x2 or 4x2 samples in the stencil buffer.
That would have been correct if the coordinates we were adjusting were
measured in pixels.  However, the conversion from pixel coordinates to
coordinates within the interleaved buffer has already been done;
therefore the full alignment restriction applies.

Note: the reason this mistake wasn't previously uncovered by piglit
tests is because it is being masked by another mistake: the blorp
engine is using overly conservative alignment restrictions when doing
stencil blits.  The overly conservative alignment restrictions will be
removed in the patch that follows.  Doing this fix now will prevent
the subsequent patch from introducing regressions.

NOTE: This is a candidate for stable release branches.

Acked-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp