i965: Implement HiZ resolves on Broadwell.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 7 Feb 2014 01:06:12 +0000 (17:06 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 19 Feb 2014 09:46:17 +0000 (01:46 -0800)
commit8cad1c115a091c2b5cb34c9d8f530204f47de9fa
treee403078fdacdbf000247bb831f844dac749f7680
parent82711611cf1dce82a667e531c2befad5a494f1cf
i965: Implement HiZ resolves on Broadwell.

Broadwell's 3DSTATE_WM_HZ_OP packet makes this much easier.

Instead of programming the whole pipeline, we simply have to emit the
depth/stencil packets, a state override, and a pipe control.  Then
arrange for the state to be put back.  This is easily done from a single
function.

v2: Use minify(mt->logical_{width,height}0, level) in 3DSTATE_WM_HZ_OP
    instead of intel_mipmap_level's width/height fields.  Those were
    based on the physical width/height, and thus wrong for MSAA buffers.
    Eric also deleted those fields.

v3: Use 0xFFFF as the sample mask regardless of what the user set (as
    this operation is unrelated); set the drawing rectangle to the
    miplevel being operated on, rather than the whole surface; remove
    unnecessary MAX2(..., 1) around mt->logical_depth0 (all suggested
    by Eric Anholt).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_blorp.cpp
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/gen8_depth_state.c