From e14f5252fac3282cd95b950fd01d40fca04e8985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Wed, 24 Apr 2024 11:44:11 +0200 Subject: [PATCH] v3dv/cmd_buffer: always bind pipeline static state Even if the pipeline is the same. The followin sequence, used on dEQP-VK.dynamic_state.*.double_static_bind tests, is valid: 1. Bind pipeline with some static state. 2. Set state command for that static state (to a bad value). 3. Bind the same pipeline again. 4. Draw. So on 3 we need to ensure to load again the pipeline static state. Fixes: dEQP-VK.dynamic_state.*.double_static_bind Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/vulkan/v3dv_cmd_buffer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_cmd_buffer.c b/src/broadcom/vulkan/v3dv_cmd_buffer.c index df169b75282..15a2e7b2435 100644 --- a/src/broadcom/vulkan/v3dv_cmd_buffer.c +++ b/src/broadcom/vulkan/v3dv_cmd_buffer.c @@ -2205,13 +2205,18 @@ bind_graphics_pipeline(struct v3dv_cmd_buffer *cmd_buffer, struct v3dv_pipeline *pipeline) { assert(pipeline && !(pipeline->active_stages & VK_SHADER_STAGE_COMPUTE_BIT)); + + /* We need to unconditionally bind the pipeline static state, as the state + * could have changed (through calls to vkCmdSetXXX) between bindings of + * the same pipeline. + */ + cmd_buffer_bind_pipeline_static_state(cmd_buffer, &pipeline->dynamic_state); + if (cmd_buffer->state.gfx.pipeline == pipeline) return; cmd_buffer->state.gfx.pipeline = pipeline; - cmd_buffer_bind_pipeline_static_state(cmd_buffer, &pipeline->dynamic_state); - cmd_buffer->state.dirty |= V3DV_CMD_DIRTY_PIPELINE; }