From d43aff3a21fcced6134540ba9945c4caac031c52 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 13 Apr 2023 17:40:50 +0200 Subject: [PATCH] radv: re-emit the guardband state when related PSO are bound If one of the related states is static, the guardband state needs to be re-emitted when a graphics pipeline is bound. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8828 Fixes: 40d8df72808 ("radv: emit the guardband state separately from the scissor state") Signed-off-by: Samuel Pitoiset Part-of: (cherry picked from commit ba71b142f8acae285fc561d6d25d3376712c5e1b) --- .pick_status.json | 2 +- src/amd/vulkan/radv_cmd_buffer.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index deaf403a7d0..0c1e8f4fb3a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -472,7 +472,7 @@ "description": "radv: re-emit the guardband state when related PSO are bound", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "40d8df728081e050b83ff0677ce4bf947e234a03" }, diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 8eae45769ab..961d13b4313 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -245,6 +245,12 @@ radv_bind_dynamic_state(struct radv_cmd_buffer *cmd_buffer, const struct radv_dy #undef RADV_CMP_COPY cmd_buffer->state.dirty |= dest_mask; + + /* Handle driver specific states that need to be re-emitted when PSO are bound. */ + if (dest_mask & (RADV_DYNAMIC_VIEWPORT | RADV_DYNAMIC_POLYGON_MODE | RADV_DYNAMIC_LINE_WIDTH | + RADV_DYNAMIC_PRIMITIVE_TOPOLOGY)) { + cmd_buffer->state.dirty |= RADV_CMD_DIRTY_GUARDBAND; + } } bool