From 5ac5572bc6768f2857f82a540b7ca7620b96de97 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 13 May 2025 16:54:06 +0200 Subject: [PATCH] radv: fix fetching conditional rendering state for DGC preprocess This state must be fetched from the stateCommandBuffer, not from the current cmdbuf which executes the preprocess(). Partial fix for https://gitlab.freedesktop.org/mesa/mesa/-/issues/13143 Cc: mesa-stable Signed-off-by: Samuel Pitoiset Part-of: (cherry picked from commit e2625fa9ca161b6c9334c4ad553391d45a573d4b) --- .pick_status.json | 2 +- src/amd/vulkan/radv_dgc.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 2f19d63f3be..096842a90fd 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5014,7 +5014,7 @@ "description": "radv: fix fetching conditional rendering state for DGC preprocess", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/amd/vulkan/radv_dgc.c b/src/amd/vulkan/radv_dgc.c index 8c94e2d5edb..b41797517b0 100644 --- a/src/amd/vulkan/radv_dgc.c +++ b/src/amd/vulkan/radv_dgc.c @@ -2803,6 +2803,7 @@ radv_CmdPreprocessGeneratedCommandsEXT(VkCommandBuffer commandBuffer, VK_FROM_HANDLE(radv_cmd_buffer, state_cmd_buffer, stateCommandBuffer); VK_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); VK_FROM_HANDLE(radv_indirect_command_layout, layout, pGeneratedCommandsInfo->indirectCommandsLayout); + const bool execution_is_predicating = state_cmd_buffer->state.predicating; assert(layout->vk.usage & VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_EXT); @@ -2812,7 +2813,7 @@ radv_CmdPreprocessGeneratedCommandsEXT(VkCommandBuffer commandBuffer, const bool old_predicating = cmd_buffer->state.predicating; cmd_buffer->state.predicating = false; - radv_prepare_dgc(cmd_buffer, pGeneratedCommandsInfo, state_cmd_buffer, old_predicating); + radv_prepare_dgc(cmd_buffer, pGeneratedCommandsInfo, state_cmd_buffer, execution_is_predicating); /* Restore conditional rendering. */ cmd_buffer->state.predicating = old_predicating; @@ -2837,8 +2838,8 @@ radv_prepare_dgc_compute(struct radv_cmd_buffer *cmd_buffer, const VkGeneratedCo if (cond_render_enabled) { params->predicating = true; - params->predication_va = cmd_buffer->state.predication_va; - params->predication_type = cmd_buffer->state.predication_type; + params->predication_va = state_cmd_buffer->state.predication_va; + params->predication_type = state_cmd_buffer->state.predication_type; } if (ies) {