i965: Make a BRW_NEW_FAST_CLEAR_COLOR dirty bit.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 16 Aug 2017 23:04:22 +0000 (16:04 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 23 Aug 2017 18:55:17 +0000 (11:55 -0700)
commit54c41af0aa92333579a72830254ac3aaa9f4aea1
tree1f7c504dd657429a42cee09acf77270dfd3e4573
parentd0b40e2c87be9378678da61742db927e842d93e6
i965: Make a BRW_NEW_FAST_CLEAR_COLOR dirty bit.

When changing fast clear colors, we need to emit new SURFACE_STATE
with the updated color at the next draw call.

Most things work today because the atoms that handle SURFACE_STATE
for images (mutable images, textures, render targets) also listen to
BRW_NEW_BLORP, causing us to re-emit these on every BLORP operation.
However, this is overkill - most BLORP operations don't require us
to re-emit SURFACE_STATE.

One case where this is broken today is a fast clear to a different
color followed by a non-coherent framebuffer fetch.  The renderbuffer
read atom doesn't listen to BRW_NEW_BLORP, and would not get the new
fast clear color.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_blorp.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_gs_surface_state.c
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
src/mesa/drivers/dri/i965/brw_tes_surface_state.c
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c