amd/common: Always use addrlib for HTILE tc-compat.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 12 Dec 2019 11:10:58 +0000 (12:10 +0100)
committerMarge Bot <eric+marge@anholt.net>
Sat, 14 Dec 2019 20:39:29 +0000 (20:39 +0000)
Even without depth+stencil addrlib can (correctly!) decide to
disable tc compatible HTILE.

One example is 8x sampling with 32-bit depth on Stoney. The row size
on Stoney is 1024, while the tile size is 2048, which results in
tile splits which are not supported with tc-compat.

On Stoney, this fixes
dEQP-VK.glsl.builtin_var.fragdepth.*_list_d32_sfloat_multisample_8

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3054>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3054>

src/amd/common/ac_surface.c

index 0376f5d79c7e95ea7fd08875d48aec68537ba403..016590fc08553959072382a8fcec6ed64511333d 100644 (file)
@@ -779,19 +779,12 @@ static int gfx6_compute_surface(ADDR_HANDLE addrlib,
                        if (level > 0)
                                continue;
 
-                       /* Check that we actually got a TC-compatible HTILE if
-                        * we requested it (only for level 0, since we're not
-                        * supporting HTILE on higher mip levels anyway). */
-                       assert(AddrSurfInfoOut.tcCompatible ||
-                              !AddrSurfInfoIn.flags.tcCompatible ||
-                              AddrSurfInfoIn.flags.matchStencilTileCfg);
+                       if (!AddrSurfInfoOut.tcCompatible) {
+                               AddrSurfInfoIn.flags.tcCompatible = 0;
+                               surf->flags &= ~RADEON_SURF_TC_COMPATIBLE_HTILE;
+                       }
 
                        if (AddrSurfInfoIn.flags.matchStencilTileCfg) {
-                               if (!AddrSurfInfoOut.tcCompatible) {
-                                       AddrSurfInfoIn.flags.tcCompatible = 0;
-                                       surf->flags &= ~RADEON_SURF_TC_COMPATIBLE_HTILE;
-                               }
-
                                AddrSurfInfoIn.flags.matchStencilTileCfg = 0;
                                AddrSurfInfoIn.tileIndex = AddrSurfInfoOut.tileIndex;
                                stencil_tile_idx = AddrSurfInfoOut.stencilTileIdx;