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

Author: Marek Olšák <[email protected]>
Date:   Sat May  2 10:56:20 2020 -0400

ac/surface: fix MSAA crash with FORCE_SWIZZLE_MODE on gfx9

Fixes: 3dc2ccc14c0e035 "ac/surface: replace RADEON_SURF_OPTIMIZE_FOR_SPACE with 
!FORCE_SWIZZLE_MODE"

Closes: #2884

Tested-by: Michel Dänzer <[email protected]>
Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4862>
(cherry picked from commit c4cdef64ad6d11e82894d24691348c38d7fad6ce)

---

 .pick_status.json           | 2 +-
 src/amd/common/ac_surface.c | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 8ade84022ec..63198d09035 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -13,7 +13,7 @@
         "description": "ac/surface: fix MSAA crash with FORCE_SWIZZLE_MODE on 
gfx9",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "3dc2ccc14c0e035368fea6ae3cce8c481f3c4ad2"
     },
diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 7cc69af4832..190b4961cf2 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -1655,7 +1655,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;
                }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to