ac/surface: 3D and cube surfaces are never displayable
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 29 Nov 2018 17:34:01 +0000 (18:34 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 19 Dec 2018 11:01:22 +0000 (12:01 +0100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_surface.c

index d8d927ee1c50ffa0ed6d3450a37209504f19f8b8..aeba5e161c9de99effdd179de7087c91b8602b60 100644 (file)
@@ -1516,10 +1516,12 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
 
        /* Query whether the surface is displayable. */
        bool displayable = false;
-       r = Addr2IsValidDisplaySwizzleMode(addrlib, surf->u.gfx9.surf.swizzle_mode,
+       if (!config->is_3d && !config->is_cube) {
+               r = Addr2IsValidDisplaySwizzleMode(addrlib, surf->u.gfx9.surf.swizzle_mode,
                                           surf->bpe * 8, &displayable);
-       if (r)
-               return r;
+               if (r)
+                       return r;
+       }
        surf->is_displayable = displayable;
 
        switch (surf->u.gfx9.surf.swizzle_mode) {