ac/surface: compute tile swizzle only when it's allowed
authorMarek Olšák <marek.olsak@amd.com>
Fri, 28 Jul 2017 21:05:38 +0000 (23:05 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 4 Aug 2017 00:10:04 +0000 (02:10 +0200)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_surface.c

index 4647ce46c59287fd40dba8ded2a783a8edd6a58e..61b4e41a3baced51b54f2fd0dbc41d738aa13f85 100644 (file)
@@ -705,8 +705,10 @@ static int gfx6_compute_surface(ADDR_HANDLE addrlib,
 
        surf->is_linear = surf->u.legacy.level[0].mode == RADEON_SURF_MODE_LINEAR_ALIGNED;
 
-       /* workout base swizzle */
-       if (!(surf->flags & RADEON_SURF_Z_OR_SBUFFER)) {
+       /* Work out tile swizzle. */
+       if (surf->u.legacy.level[0].mode == RADEON_SURF_MODE_2D &&
+           !(surf->flags & (RADEON_SURF_Z_OR_SBUFFER | RADEON_SURF_SHAREABLE)) &&
+           (config->info.samples > 1 || !(surf->flags & RADEON_SURF_SCANOUT))) {
                ADDR_COMPUTE_BASE_SWIZZLE_INPUT AddrBaseSwizzleIn = {0};
                ADDR_COMPUTE_BASE_SWIZZLE_OUTPUT AddrBaseSwizzleOut = {0};