i965: Move surface resolves back to draw/dispatch time
This is effectively a revert of
388f02729bbf88ba104f4f8ee1fdf005a240969c
though much code has been added since. Kristian initially moved it to
try and avoid locking problems with meta-based resolves. Now that meta
is gone from the resolve path (for good this time, we hope), we can move
it back. The problem with having it in intel_update_state was that the
UpdateState hook gets called by core mesa directly and all sorts of
things will cause a UpdateState to get called which may trigger resolves
at inopportune times. In particular, it gets called by _mesa_Clear and,
if we have a HiZ buffer in the INVALID_AUX state, causes a HiZ resolve
right before the clear which is pointless. By moving it back to
try_draw_prims time, we know it will only get called right before a draw
which is where we want it.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>