Mesa (main): radv: do not load/store the clear value for comp-to-single images

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Aug 30 07:36:46 UTC 2021


Module: Mesa
Branch: main
Commit: df688e6941bc89ae1ba9cdc53fc464cc36652551
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=df688e6941bc89ae1ba9cdc53fc464cc36652551

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Aug 26 18:00:39 2021 +0200

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 <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12565>

---

 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);



More information about the mesa-commit mailing list