OSDN Git Service

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)
committerDylan Baker <dylan@pnwbakers.com>
Wed, 20 Nov 2019 00:54:04 +0000 (16:54 -0800)
commit48f8f0edca06280d56ff97a2984e605f25d5406b
treea5bd2889ce226d4dbc1ffa74e2d2bc1bebd561f1
parent3b8461cf162e8c092fb44cff2f5e5a99ecc23112
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>
(cherry picked from commit 6f17fe0606a144f977d8b70a7ee9f8371abc144b)
src/mesa/drivers/dri/i965/genX_state_upload.c