From a1c87235a9d077b32094725ad7ea3b9919743c9f Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sat, 19 May 2018 01:03:57 +0200 Subject: [PATCH] ac/surface: Only align linear power of two fmt textures. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/amd/common/ac_surface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index 9e742dc8a45..d7da9950256 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -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); } -- 2.30.2