Mesa (staging/20.3): radv: Use stricter HW resolve swizzle compat check.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Mar 17 19:57:07 UTC 2021


Module: Mesa
Branch: staging/20.3
Commit: bad347c2588252d907b33296a0b74878eba468d0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bad347c2588252d907b33296a0b74878eba468d0

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sat Jan 23 02:36:29 2021 +0100

radv: Use stricter HW resolve swizzle compat check.

D and linear are both DISPLAY micro tiling according to ac_surface
but don't work together. This fixes an issue with GFX9+.

This fixes the SkQP WritePixelsNonTexture_Gpu test.

Fixes: 69ea473eeb9 ("amd/addrlib: update to the latest version")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9557>

---

 src/amd/vulkan/radv_meta_resolve.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_meta_resolve.c b/src/amd/vulkan/radv_meta_resolve.c
index b917d31508a..b0a4abdab40 100644
--- a/src/amd/vulkan/radv_meta_resolve.c
+++ b/src/amd/vulkan/radv_meta_resolve.c
@@ -350,6 +350,19 @@ enum radv_resolve_method {
 	RESOLVE_FRAGMENT,
 };
 
+static bool image_hw_resolve_compat(const struct radv_device *device,
+				    struct radv_image *src_image,
+				    struct radv_image *dst_image)
+{
+	if (device->physical_device->rad_info.chip_class >= GFX9) {
+		return dst_image->planes[0].surface.u.gfx9.surf.swizzle_mode ==
+		       src_image->planes[0].surface.u.gfx9.surf.swizzle_mode;
+	} else {
+		return dst_image->planes[0].surface.micro_tile_mode ==
+		       src_image->planes[0].surface.micro_tile_mode;
+	}
+}
+
 static void radv_pick_resolve_method_images(struct radv_device *device,
 					    struct radv_image *src_image,
 					    VkFormat src_format,
@@ -373,8 +386,7 @@ static void radv_pick_resolve_method_images(struct radv_device *device,
 		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) {
+		} else if (!image_hw_resolve_compat(device, src_image, dest_image)) {
 			*method = RESOLVE_COMPUTE;
 		}
 



More information about the mesa-commit mailing list