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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40221>
This commit is contained in:
Samuel Pitoiset 2026-03-04 15:14:23 +01:00 committed by Marge Bot
parent ac3fd06987
commit 1a00587c44

View file

@ -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;
}