summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-09-17 20:17:33 -0700
committerDave Airlie <[email protected]>2017-09-20 15:32:05 +1000
commitc4ac522511d20683c09441a9e96ddfbc1b540c00 (patch)
tree834325c46dbee2e2b69d4b1193c2cc5762bdf1d8
parent39d539e321c6c97433a15660c9d9a20ad8657ff0 (diff)
ac/surface: handle S8 on gfx9
If we don't have a depth piece, we don't get a correct swizzle mode and we hit an assert in addrlib. In case of no depth get the preferrred swizzle mode for stencil alone. Reviewed-by: Marek Olšák <[email protected]> Cc: "17.2" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r--src/amd/common/ac_surface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index 88cc8a10681..850d70715e5 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -1138,9 +1138,14 @@ static int gfx9_compute_surface(ADDR_HANDLE addrlib,
/* Calculate texture layout information for stencil. */
if (surf->flags & RADEON_SURF_SBUFFER) {
- AddrSurfInfoIn.bpp = 8;
- AddrSurfInfoIn.flags.depth = 0;
AddrSurfInfoIn.flags.stencil = 1;
+ AddrSurfInfoIn.bpp = 8;
+
+ if (!AddrSurfInfoIn.flags.depth)
+ r = gfx9_get_preferred_swizzle_mode(addrlib, &AddrSurfInfoIn, false,
+ &AddrSurfInfoIn.swizzleMode);
+ else
+ AddrSurfInfoIn.flags.depth = 0;
r = gfx9_compute_miptree(addrlib, surf, compressed, &AddrSurfInfoIn);
if (r)