radeonsi/gfx10: flush gfx cs on ngg -> legacy transition
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 23 Nov 2020 12:48:42 +0000 (13:48 +0100)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 26 Nov 2020 09:19:26 +0000 (10:19 +0100)
commit0b3bd7c5167c7d7a87ded47730641a4103996591
treeb4e8db664dfc2779f3f8c3e4bab5aecba7ebc186
parent33a78948283c9911a06650bd2ba5467678249cfd
radeonsi/gfx10: flush gfx cs on ngg -> legacy transition

with a sequence like this:

  glClear(STENCIL)
  glBeginTransformFeedback()
  ...
  glEndTransformFeedback()
  glClear(STENCIL)

The second clear sometimes may produce an unexpected result.

Calling si_flush_gfx_cs() when doing ngg -> legacy transition seems to be a
valid workaround (both for the synthetic reproducer and the real Blender bug).

Using flush flags or events (BOTTOM_OF_PIPE_TS, RESET_TO_LOWEST_VGT) didn't help.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2941
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7750>
src/gallium/drivers/radeonsi/si_state_shaders.c