ac/surface: fix an assertion failure on gfx9 in CMASK computation
authorMarek Olšák <marek.olsak@amd.com>
Fri, 20 Dec 2019 21:19:54 +0000 (16:19 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 20 Dec 2019 22:57:08 +0000 (22:57 +0000)
addrlib only allows the 2D resource type with CMASK.

Fixes: 69ea473eeb9 "amd/addrlib: update to the latest version"
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3187>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3187>

src/amd/common/ac_surface.c

index 09f2bb75ea021bf98160bc1fe9130c398dc99c76..81c77e280ae0732f526090de436480d30b402e76 100644 (file)
@@ -1352,6 +1352,7 @@ 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) ||
                     (surf->fmask_size && in->numSamples >= 2))) {
                        ADDR2_COMPUTE_CMASK_INFO_INPUT cin = {0};