From 1a00587c44ecb97d9978cd6bed8e76e56c6697f5 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 4 Mar 2026 15:14:23 +0100 Subject: [PATCH] radv: fix a GPU hang with PS epilogs and secondary command buffers If the secondary changes the fragment output state and if the same PS epilog used before ExecuteCommands() is re-bind immediately after that call, the PS epilog state wouldn't be re-emitted. Apply the same change for VS prologs, although the logic is slightly different and the bug shouldn't occur. The whole logic of secondaries should be completely rewritten because it's definitely not robust. This fixes a GPU hang in Where Winds Meet, see https://github.com/doitsujin/dxvk/issues/5436. Cc: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 0e81b623be4..67195e78186 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -9770,6 +9770,9 @@ radv_CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCou primary->state.emitted_compute_pipeline = secondary->state.emitted_compute_pipeline; primary->state.emitted_rt_pipeline = secondary->state.emitted_rt_pipeline; + primary->state.ps_epilog = secondary->state.ps_epilog; + primary->state.emitted_vs_prolog = secondary->state.emitted_vs_prolog; + if (secondary->state.last_ia_multi_vgt_param) { primary->state.last_ia_multi_vgt_param = secondary->state.last_ia_multi_vgt_param; }