From df688e6941bc89ae1ba9cdc53fc464cc36652551 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 26 Aug 2021 18:00:39 +0200 Subject: [PATCH] radv: do not load/store the clear value for comp-to-single images Images that are fast cleared with the comp-to-single mode clears DCC to 0x10 which tells the hardware to get the clear value from the main surface instead of the reg. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 7c14f6de2a0..1e4ac2de100 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -2280,6 +2280,12 @@ radv_update_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer, assert(radv_image_has_cmask(image) || radv_dcc_enabled(image, iview->base_mip)); + /* Do not need to update the clear value for images that are fast cleared with the comp-to-single + * mode because the hardware gets the value from the image directly. + */ + if (iview->image->support_comp_to_single) + return; + radv_set_color_clear_metadata(cmd_buffer, image, &range, color_values); radv_update_bound_fast_clear_color(cmd_buffer, image, cb_idx, color_values); @@ -2298,6 +2304,9 @@ radv_load_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer, struct radv_i if (!radv_image_has_cmask(image) && !radv_dcc_enabled(image, iview->base_mip)) return; + if (iview->image->support_comp_to_single) + return; + if (!radv_image_has_clear_value(image)) { uint32_t color_values[2] = {0, 0}; radv_update_bound_fast_clear_color(cmd_buffer, image, cb_idx, color_values);