archrelease: copy trunk to extra-x86_64
[arch-packages.git] / mesa / repos / testing-x86_64 / 0001-anv-force-MEDIA_INTERFACE_DESCRIPTOR_LOAD-reemit-aft.patch
blobeffa48949c03d2f0eefac54111cea75922bf9735
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
3 Date: Sun, 12 Jun 2022 23:59:05 +0300
4 Subject: [PATCH] anv: force MEDIA_INTERFACE_DESCRIPTOR_LOAD reemit after
5 3D->GPGPU switch
7 Seems to fix a hang in the following titles :
8 - Age of Empire 4
9 - Monster Hunter Rise
11 where the HW is hung on a PIPE_CONTROL after a GPGPU_WALKER but no
12 MEDIA_INTERFACE_DESCRIPTOR_LOAD was emitted since the switch from 3D
13 to GPGPU.
15 This would happen in the following case :
17 vkCmdBindPipeline(COMPUTE, cs_pipeline);
18 vkCmdDispatch(...);
19 vkCmdBindPipeline(GRAPHICS, gfx_pipeline);
20 vkCmdDraw(...);
21 vkCmdDispatch(...);
23 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
24 ---
25 src/intel/vulkan/genX_cmd_buffer.c | 14 ++++++++++++++
26 1 file changed, 14 insertions(+)
28 diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
29 index 17629fb7ac87..1651c29d9ebd 100644
30 --- a/src/intel/vulkan/genX_cmd_buffer.c
31 +++ b/src/intel/vulkan/genX_cmd_buffer.c
32 @@ -6003,6 +6003,20 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer,
34 #endif
36 +#if GFX_VERx10 == 120
37 + /* Undocumented workaround to force the re-emission of
38 + * MEDIA_INTERFACE_DESCRIPTOR_LOAD when switching from 3D to Compute
39 + * pipeline without rebinding a pipeline :
40 + * vkCmdBindPipeline(COMPUTE, cs_pipeline);
41 + * vkCmdDispatch(...);
42 + * vkCmdBindPipeline(GRAPHICS, gfx_pipeline);
43 + * vkCmdDraw(...);
44 + * vkCmdDispatch(...);
45 + */
46 + if (pipeline == _3D)
47 + cmd_buffer->state.compute.pipeline_dirty = true;
48 +#endif
50 /* From "BXML » GT » MI » vol1a GPU Overview » [Instruction]
51 * PIPELINE_SELECT [DevBWR+]":