anv: Apply any needed PIPE_CONTROLs before emitting state
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 16 Apr 2020 20:33:43 +0000 (15:33 -0500)
committerMarge Bot <eric+marge@anholt.net>
Sun, 19 Apr 2020 02:41:22 +0000 (02:41 +0000)
commit969aeb6a93aefd037b130e4b37f58043fef493c3
tree68bd38100cb6e4cb475651365d32e75effea433e
parentffc84eac0d5a0c30e445fcdb2f0cfd0c5bf5321d
anv: Apply any needed PIPE_CONTROLs before emitting state

Push constants in particular can get picked up by the hardware at weird
times that happen *before* 3DPRIMITIVE.  Therefore, we need to flush
before we emit all our state to ensure that any data they may pick up is
in memory in time.  This fixes an app which does vkCmdCopyBuffers
immediately followed by a vkCmdBeginRenderPass and vkCmdDraw which uses
the destination of the copy as a UBO which we push.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4601>
src/intel/vulkan/genX_cmd_buffer.c