i965/Gen7: Set up layer constraints properly for depth buffers
authorChris Forbes <chrisf@ijw.co.nz>
Thu, 8 May 2014 04:29:41 +0000 (16:29 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Thu, 8 May 2014 21:46:19 +0000 (09:46 +1200)
commit77d55ef4819436ebbf9786a1e720ec00707bbb19
tree910343e09a093a8725ff306f8073e65b757b3d3f
parent9269ea599cf8b22577fe4dc5996535f2cc0b7950
i965/Gen7: Set up layer constraints properly for depth buffers

Again, a few problems:
- Layered attachments did not honor MinLayer.
- Non-layered MSAA attachments rendered to the wrong layer due to
  dividing by the layer count. All depth buffers use the IMS layout, so
  the physical layer count == logical layer count.
- Layered attachments were not limited to irb->layer_count, so we could
  render off the end of the texture.

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_misc_state.c