From 65406cf500a3da1dc492466c518a85bd36794927 Mon Sep 17 00:00:00 2001 From: Olivia Lee Date: Tue, 13 May 2025 17:55:01 -0700 Subject: [PATCH] panvk/csf: fix provoking vertex mode in partial secondary cmdbufs For partial secondary cmdbufs, we emit FBDs/TDs in the primary cmdbuf before calling the secondary. In order to set the provoking vertex mode correctly here, we need to look at the mode set by pipelines bound in the secondary cmdbuf. This leaves one edge case: reemitting FBDs/TDs in a secondary cmdbuf after a flush. If the secondary cmdbuf only contains vk_meta draws, without ever binding a pipeline, we won't know which provoking vertex mode to use here. This is actually okay, because in that case the provoking vertex mode doesn't matter for any of the draws in the secondary, and the FBDs/TDs will be reemitted on the primary with the correct mode. Fixes: 7a9f14d3c2b ("panvk: advertise VK_EXT_provoking_vertex") Signed-off-by: Olivia Lee Tested-by: Mary Guillemard Reviewed-by: Mary Guillemard Reviewed-by: Ryan Mckeever Part-of: --- src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c b/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c index a141da9b547..5b10201635e 100644 --- a/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c +++ b/src/panfrost/vulkan/csf/panvk_vX_cmd_draw.c @@ -2356,6 +2356,9 @@ panvk_per_arch(cmd_prepare_exec_cmd_for_draws)( return VK_SUCCESS; if (!inherits_render_ctx(primary)) { + enum u_tristate first_provoking_vertex = + secondary->state.gfx.render.first_provoking_vertex; + set_provoking_vertex_mode(primary, first_provoking_vertex); VkResult result = get_render_ctx(primary); if (result != VK_SUCCESS) return result;