From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 12 Jun 2022 23:59:05 +0300 Subject: [PATCH] anv: force MEDIA_INTERFACE_DESCRIPTOR_LOAD reemit after 3D->GPGPU switch Seems to fix a hang in the following titles : - Age of Empire 4 - Monster Hunter Rise where the HW is hung on a PIPE_CONTROL after a GPGPU_WALKER but no MEDIA_INTERFACE_DESCRIPTOR_LOAD was emitted since the switch from 3D to GPGPU. This would happen in the following case : vkCmdBindPipeline(COMPUTE, cs_pipeline); vkCmdDispatch(...); vkCmdBindPipeline(GRAPHICS, gfx_pipeline); vkCmdDraw(...); vkCmdDispatch(...); Signed-off-by: Lionel Landwerlin Reviewed-by: Ivan Briano Cc: mesa-stable Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 25d337945896..1b382cae49a1 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -6383,6 +6383,20 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer, } #endif +#if GFX_VERx10 == 120 + /* Undocumented workaround to force the re-emission of + * MEDIA_INTERFACE_DESCRIPTOR_LOAD when switching from 3D to Compute + * pipeline without rebinding a pipeline : + * vkCmdBindPipeline(COMPUTE, cs_pipeline); + * vkCmdDispatch(...); + * vkCmdBindPipeline(GRAPHICS, gfx_pipeline); + * vkCmdDraw(...); + * vkCmdDispatch(...); + */ + if (pipeline == _3D) + cmd_buffer->state.compute.pipeline_dirty = true; +#endif + #if GFX_VER >= 12 /* From Tigerlake PRM, Volume 2a, PIPELINE_SELECT: *