i965/blorp: store x and y offsets in brw_blorp_mip_info.
authorPaul Berry <stereotype441@gmail.com>
Wed, 29 Aug 2012 19:16:06 +0000 (12:16 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 28 Sep 2012 18:20:38 +0000 (11:20 -0700)
commit127dc6d136db64fcf9448d66cb4c86db3bb11226
tree0d2a0536eddcd78ad65e7bc1ae2ad524e095cafe
parent602e9a0f3727b036caf3a7b228fe90d36d832ea7
i965/blorp: store x and y offsets in brw_blorp_mip_info.

Currently, gen{6,7}_blorp_emit_surface_state assumes that the src and
dst surfaces are mapped to miplevel 0 and layer 0 (thus no surface
offset is required).  This is a bug, since the user might try to blit
to and from levels/layers other than 0.

To fix this bug, it will not be sufficient to have
gen6_{6,7}_blorp_emit_surface_state look up the surface offset at the
time they set up the surface state, since these offsets will need to
be tweaked when blitting stencil buffers (due to the fact that stencil
buffer blits have to swizzle between W and Y tiling formats).

So, to pave the way for the bug fix, this patch causes the x and y
offsets to be computed during blit setup and stored in
brw_blorp_mip_info.

As a result of this change, brw_blorp_mip_info doesn't need to store
the level and layer anymore.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c130ce7b2b26b4b67d4bf2b6dd1044a200efe25d)
src/mesa/drivers/dri/i965/brw_blorp.cpp
src/mesa/drivers/dri/i965/brw_blorp.h
src/mesa/drivers/dri/i965/gen6_blorp.cpp
src/mesa/drivers/dri/i965/gen7_blorp.cpp