ac/surface: fix MSAA crash with FORCE_SWIZZLE_MODE on gfx9
authorMarek Olšák <marek.olsak@amd.com>
Sat, 2 May 2020 14:56:20 +0000 (10:56 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 4 May 2020 20:03:15 +0000 (20:03 +0000)
Fixes: 3dc2ccc14c0e035 "ac/surface: replace RADEON_SURF_OPTIMIZE_FOR_SPACE with !FORCE_SWIZZLE_MODE"
Closes: #2884
Tested-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4862>

src/amd/common/ac_surface.c

index 474be97d0b4003af75e0e5c8345f3e679742a72a..64bfa4198390e583d8ee7b3a2bed632b85247430 100644 (file)
@@ -1658,7 +1658,9 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
 
        case RADEON_SURF_MODE_1D:
        case RADEON_SURF_MODE_2D:
-               if (surf->flags & (RADEON_SURF_IMPORTED | RADEON_SURF_FORCE_SWIZZLE_MODE)) {
+               if (surf->flags & RADEON_SURF_IMPORTED ||
+                    (info->chip_class >= GFX10 &&
+                     surf->flags & RADEON_SURF_FORCE_SWIZZLE_MODE)) {
                        AddrSurfInfoIn.swizzleMode = surf->u.gfx9.surf.swizzle_mode;
                        break;
                }