i965/gen9: Allow sampling with hiz when supported
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 21 Oct 2016 15:50:50 +0000 (16:50 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 8 Nov 2016 16:13:57 +0000 (16:13 +0000)
commit112a2ba2763f14351de33501d2731dbdcab48658
treea20f04e5d64cec49cea98d155cec71af1cd1885f
parent3b0c2bc41755db2f2cef487f367e697aa57dcd78
i965/gen9: Allow sampling with hiz when supported

For gen9+ this will indicate when we should allow hiz based sampling
during rendering.

Improves performance in :
  - Synmark's OglDeferred by 2.2% (n=20)
  - Synmark's OglShMapPcf by 0.44% (n=20)

v2 by Ben: Add spec reference, and make it fix with some of the changes made on
the previous patches
Change the check from mt->aux_buf to mt->num_samples. The presence of an aux_buf
isn't enough to determine there isn't a HiZ buffer to use.

v3: It seems all depth surface end up with num_samples = 0 by default,
    so allow sampling from depth HiZ if num_samples <= 1. (Lionel)
    Allow sampling from HiZ only if all LOD are available from the HiZ
    buffer. (Lionel)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> (v1)
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com> (v2)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v3)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/mesa/drivers/dri/i965/intel_mipmap_tree.c