i965: Unify CC_STATE and BLEND_STATE atoms on Haswell as a workaround
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Thu, 14 Nov 2019 13:36:27 +0000 (15:36 +0200)
committerDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Mon, 18 Nov 2019 09:00:23 +0000 (11:00 +0200)
commit6f17fe0606a144f977d8b70a7ee9f8371abc144b
tree7c1a0cd07b3147740b7f325aad392832d471698e
parent1ebd9459e790bc14e3e58749c1d27ee0d7738a22
i965: Unify CC_STATE and BLEND_STATE atoms on Haswell as a workaround

Re-emitting 3DSTATE_CC_STATE_POINTERS after emitting
3DSTATE_BLEND_STATE_POINTERS fixes the shadow flickering in
SuperTuxCart and Tropico 6 which was seen only on Haswell.
The reason for this is unknown and fix was found empirically.

The closest mention in PRM is that it should improve performance.
From the HSW PRM, volume 2b, page 823 (3DSTATE_BLEND_STATE_POINTERS):
 "When the BLEND_STATE pointer changes but not the CC_STATE pointer,
  driver needs to force a CC_STATE pointer change to improve
  blend performance in pixel backend."

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1834
Fixes: eca4a654 ("i965: Disable dual source blending when shader doesn't support it on gen8+")
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/genX_state_upload.c