From: Jonathan Marek Date: Tue, 26 Feb 2019 17:00:01 +0000 (-0500) Subject: freedreno: a2xx: fix mipmapping for NPOT textures X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c0fefb448f0b72971c96a60907c77ce0512d590;p=mesa.git freedreno: a2xx: fix mipmapping for NPOT textures Fixes: 3a273a4a Signed-off-by: Jonathan Marek --- diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_resource.c b/src/gallium/drivers/freedreno/a2xx/fd2_resource.c index 1bd1f103ccd..2c813804689 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_resource.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_resource.c @@ -55,6 +55,12 @@ fd2_setup_slices(struct fd_resource *rsc) break; } + /* mipmaps have power of two sizes in memory */ + if (level) { + width = util_next_power_of_two(width); + height = util_next_power_of_two(height); + } + slice->pitch = width; slice->offset = size;