From f858d2238e5ca3af3c362e90ca18a2784c1b456c 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 (cherry picked from commit 1a00587c44ecb97d9978cd6bed8e76e56c6697f5) Part-of: --- .pick_status.json | 2 +- src/amd/vulkan/radv_cmd_buffer.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index aaa12c263c7..e5a5ebe6e06 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1414,7 +1414,7 @@ "description": "radv: fix a GPU hang with PS epilogs and secondary command buffers", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index b2bd3d987ed..5591b90cca7 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -9780,6 +9780,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; }