From 9061f5f57d95d27e1ed4c0667fd48c085eea602f Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 10 Oct 2022 22:05:00 +0200 Subject: [PATCH] tu: Clear viewport dirty state with static viewports Vulkan allows the user to set extraneous dynamic state which then gets ignored if a pipeline with static state is bound. We weren't implementing this correctly for viewports because we weren't clearing the dirty bit, but it was happening to work until changes for dynamic depth negative-one-to-one broke dEQP-VK.pipeline.*.depth.depth_clip_control.d32_sfloat_less_viewport_before_static. Part-of: --- src/freedreno/vulkan/tu_cmd_buffer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index db18d289e49..a15055ce259 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -2613,6 +2613,9 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer, cmd->state.dirty |= TU_CMD_DIRTY_VIEWPORTS; } + if (!(pipeline->dynamic_state_mask & BIT(VK_DYNAMIC_STATE_VIEWPORT))) + cmd->state.dirty &= ~TU_CMD_DIRTY_VIEWPORTS; + if (!(pipeline->dynamic_state_mask & BIT(TU_DYNAMIC_STATE_VERTEX_INPUT))) tu_update_num_vbs(cmd, pipeline->vi.num_vbs);