From 8db739880af2d50e871b6bd27437a2ad37cf6c00 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 19 May 2020 01:32:38 -0400 Subject: [PATCH] ac/surface: don't compute single-sample CMASK if it's unaligned Displayable DCC can cause this and fail the assertion later. Fixes: cf61f635ff6a38aad344ebe30551eaaac6fec038 Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/common/ac_surface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index 1c2c0d8dad2..0a7d9e0d9b2 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -1471,7 +1471,10 @@ static int gfx9_compute_miptree(ADDR_HANDLE addrlib, /* CMASK -- on GFX10 only for FMASK */ if (in->swizzleMode != ADDR_SW_LINEAR && in->resourceType == ADDR_RSRC_TEX_2D && - ((info->chip_class <= GFX9 && in->numSamples == 1) || + ((info->chip_class <= GFX9 && + in->numSamples == 1 && + in->flags.metaPipeUnaligned == 0 && + in->flags.metaRbUnaligned == 0) || (surf->fmask_size && in->numSamples >= 2))) { ADDR2_COMPUTE_CMASK_INFO_INPUT cin = {0}; ADDR2_COMPUTE_CMASK_INFO_OUTPUT cout = {0}; -- 2.30.2