ac/surface: Only align linear power of two fmt textures.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 18 May 2018 23:03:57 +0000 (01:03 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 20 May 2018 09:57:59 +0000 (11:57 +0200)
We're not sharing 32_32_32 formats between different GPUs, so we
do not have to align for vega on pre-vega cards.

Fixes: e361970ed73 "radv: Add support for IMG_DATA_FORMAT_32_32_32."
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_surface.c

index 9e742dc8a4501f7ebf20cb099c6c23e96716f989..d7da99502564b82bba4bde1e34937397c0a7dd94 100644 (file)
@@ -301,10 +301,10 @@ static int gfx6_compute_level(ADDR_HANDLE addrlib,
         */
        if (config->info.levels == 1 &&
            AddrSurfInfoIn->tileMode == ADDR_TM_LINEAR_ALIGNED &&
-           AddrSurfInfoIn->bpp) {
+           AddrSurfInfoIn->bpp &&
+           util_is_power_of_two_or_zero(AddrSurfInfoIn->bpp)) {
                unsigned alignment = 256 / (AddrSurfInfoIn->bpp / 8);
 
-               assert(util_is_power_of_two_or_zero(AddrSurfInfoIn->bpp));
                AddrSurfInfoIn->width = align(AddrSurfInfoIn->width, alignment);
        }