i965/miptree: Allocate HiZ up-front
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 12 Jul 2017 23:29:45 +0000 (16:29 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 17 Jul 2017 20:48:38 +0000 (13:48 -0700)
commit67143a50374662d8c1117eab2a633aeaed735694
treec07fbf51cacd803e9a14b7c85517a9f241ae0358
parent138316cc995182b0a3cd72e4ec06b67651a99a2c
i965/miptree: Allocate HiZ up-front

HiZ, like MCS and CCS_E, can compress more than just clear colors so we
want it turned on whenever the miptree is being used as a depth
attachment.  It's theoretically possible for someone to create a depth
texture, upload data with glTexSubImage2D, and texture from it without
ever binding it as a depth target.  If this happens, we would end up
wasting a bit of space by allocating a HiZ surface we never use.
However, this is rather unlikely out side of test cases, so we're better
off just allocating it up-front.

Reviewed-by: Chad Versace <chadversary@chromium.org>
src/mesa/drivers/dri/i965/intel_fbo.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.c