Mesa (master): radv: fix color resolves if the dest image has DCC

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 12 16:12:53 UTC 2021


Module: Mesa
Branch: master
Commit: 20af07d08908d29b1c4cfd80e48d7611855e404e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=20af07d08908d29b1c4cfd80e48d7611855e404e

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Tue Jan  5 10:19:03 2021 +0100

radv: fix color resolves if the dest image has DCC

Using the graphics resolve path when DCC is enabled should only be
a hint to avoid DCC fixup.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3388
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/8326>

---

 src/amd/vulkan/radv_meta_resolve.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c
index 8ed3f405644..bfa8c22e534 100644
--- a/src/amd/vulkan/radv_meta_resolve.c
+++ b/src/amd/vulkan/radv_meta_resolve.c
@@ -362,6 +362,19 @@ static void radv_pick_resolve_method_images(struct radv_device *device,
 	                                                   cmd_buffer->queue_family_index);
 
 	if (vk_format_is_color(src_format)) {
+		/* Using the fragment resolve path is currently a hint to
+		 * avoid decompressing DCC for partial resolves and
+		 * re-initialize it after resolving using compute.
+		 * TODO: Add support for layered and int to the fragment path.
+		 */
+		if (radv_layout_dcc_compressed(device, dest_image, dest_image_layout,
+		                               dest_render_loop, queue_mask)) {
+			*method = RESOLVE_FRAGMENT;
+		} else if (dest_image->planes[0].surface.micro_tile_mode !=
+		           src_image->planes[0].surface.micro_tile_mode) {
+			*method = RESOLVE_COMPUTE;
+		}
+
 		if (src_format == VK_FORMAT_R16G16_UNORM ||
 		    src_format == VK_FORMAT_R16G16_SNORM)
 			*method = RESOLVE_COMPUTE;
@@ -370,14 +383,6 @@ static void radv_pick_resolve_method_images(struct radv_device *device,
 		else if (src_image->info.array_size > 1 ||
 			 dest_image->info.array_size > 1)
 			*method = RESOLVE_COMPUTE;
-
-		if (radv_layout_dcc_compressed(device, dest_image, dest_image_layout,
-		                               dest_render_loop, queue_mask)) {
-			*method = RESOLVE_FRAGMENT;
-		} else if (dest_image->planes[0].surface.micro_tile_mode !=
-		           src_image->planes[0].surface.micro_tile_mode) {
-			*method = RESOLVE_COMPUTE;
-		}
 	} else {
 		if (src_image->info.array_size > 1 ||
 		    dest_image->info.array_size > 1)



More information about the mesa-commit mailing list