anv: fix index buffer emission
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sun, 12 Jun 2022 20:54:12 +0000 (23:54 +0300)
committerMarge Bot <emma+marge@anholt.net>
Tue, 21 Jun 2022 16:24:10 +0000 (16:24 +0000)
commit4f10eddf77f64fd942c7e9b5852becfa3569924e
tree9c2b0290e38d4a2113a96e26e56a754e7f24b87a
parent21ea19d504bb96aea9f218fe6bfa5a9a40a72eb9
anv: fix index buffer emission

In the following case :

  vkCmdBindPipeline(compute_pipeline);
  vkCmdDispatch(...);
  vkCmdBindPipeline(graphics_pipeline);
  vkCmdBindIndexBuffer(buffer)
  vkCmdDraw(...);

We're emitting the 3DSTATE_INDEX_BUFFER instruction while the HW is
still in GPGPU mode, because we're dealing the pipeline selection to
vkCmdDraw().

Found while debugging Age Of Empire 4, HW is hung on
3DSTATE_INDEX_BUFFER instruction.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17153>
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_cmd_buffer.c
src/intel/vulkan/gfx7_cmd_buffer.c
src/intel/vulkan/gfx8_cmd_buffer.c