From 264d64cc6cba7aaf09bdfc1cca66a2dc526fc055 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 13 Jan 2023 10:32:08 +0100 Subject: [PATCH] radv: fix re-emitting RB+ when the non-compacted color format changes If the previously emitted graphics pipeline uses the value A for col_format_non_compacted and the new bound graphics pipeline uses B. At bind time, radv_cmd_state::col_format_non_compacted will be set to B and the rbplus flag will be dirtied. But if there is no draws and a new graphics pipeline is bound with the same value as A, the next draw will emit the rbplus state with B instead of A. This can be basically triggered with meta operations after drawing because the driver saves/restores the bound pipeline. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8073 Fixes: 11469f7553d ("radv: copy the non-compacted color format at pipeline bind time") Signed-off-by: Samuel Pitoiset Part-of: (cherry picked from commit 5b3fb44ecc602bb1f6ed59222ae919ef119bf733) --- .pick_status.json | 2 +- src/amd/vulkan/radv_cmd_buffer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 18161c14402..3ca56031087 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -175,7 +175,7 @@ "description": "radv: fix re-emitting RB+ when the non-compacted color format changes", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "11469f7553dc69a6c4b779527e6738c3206aa21c" }, diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index c79e633a62c..b61dc02277f 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -6233,7 +6233,7 @@ radv_CmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipeline if (cmd_buffer->device->physical_device->rad_info.rbplus_allowed && (!cmd_buffer->state.emitted_graphics_pipeline || - cmd_buffer->state.emitted_graphics_pipeline->col_format_non_compacted != graphics_pipeline->col_format_non_compacted)) { + cmd_buffer->state.col_format_non_compacted != graphics_pipeline->col_format_non_compacted)) { cmd_buffer->state.col_format_non_compacted = graphics_pipeline->col_format_non_compacted; cmd_buffer->state.dirty |= RADV_CMD_DIRTY_RBPLUS; }