From: Marek Olšák Date: Mon, 26 Mar 2018 18:32:56 +0000 (-0400) Subject: ac/surface: set AddrSurfInfoIn.format = ADDR_FMT_8 for stencil, add assertions X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f96747530be799e3ccd84ccf48df6d7fdbd0a03;p=mesa.git ac/surface: set AddrSurfInfoIn.format = ADDR_FMT_8 for stencil, add assertions Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105738 Tested-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index 12dfc0cb1f2..81882576baf 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -1157,18 +1157,25 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib, } else { switch (surf->bpe) { case 1: + assert(!(surf->flags & RADEON_SURF_ZBUFFER)); AddrSurfInfoIn.format = ADDR_FMT_8; break; case 2: + assert(surf->flags & RADEON_SURF_ZBUFFER || + !(surf->flags & RADEON_SURF_SBUFFER)); AddrSurfInfoIn.format = ADDR_FMT_16; break; case 4: + assert(surf->flags & RADEON_SURF_ZBUFFER || + !(surf->flags & RADEON_SURF_SBUFFER)); AddrSurfInfoIn.format = ADDR_FMT_32; break; case 8: + assert(!(surf->flags & RADEON_SURF_Z_OR_SBUFFER)); AddrSurfInfoIn.format = ADDR_FMT_32_32; break; case 16: + assert(!(surf->flags & RADEON_SURF_Z_OR_SBUFFER)); AddrSurfInfoIn.format = ADDR_FMT_32_32_32_32; break; default: @@ -1258,6 +1265,7 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib, if (surf->flags & RADEON_SURF_SBUFFER) { AddrSurfInfoIn.flags.stencil = 1; AddrSurfInfoIn.bpp = 8; + AddrSurfInfoIn.format = ADDR_FMT_8; if (!AddrSurfInfoIn.flags.depth) { r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, false,