i965/Gen7: Set up layer constraints properly for renderbuffers
authorChris Forbes <chrisf@ijw.co.nz>
Thu, 8 May 2014 04:02:16 +0000 (16:02 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 8 May 2014 21:46:19 +0000 (09:46 +1200)
commitdd43900b7bb3bec0b136bb244a04841123575467
tree00afb61f1c1f35cfb5c5bdb29dc6be64dfc064b0
parentcc8c00da885ba1446e73b77d9171965d1299ad37
i965/Gen7: Set up layer constraints properly for renderbuffers

There were a few problems here, which mostly just broke layered
rendering into a view:

- Render target view extent was always set to be == depth. This is
  benign for non-layered-rendering, but allows writes off the end of the
  render target for layered rendering, which ends badly.
- Layered rendering did not honor the mt_layer setting, so would not
  properly handle MinLayer being set on a view.

V2: Restore the MAX2() to account for zero depth/layer_count.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c