From: Jonathan Marek Date: Fri, 22 May 2020 14:12:02 +0000 (-0400) Subject: freedreno/a4xx: restore pitch to bytes change to layout code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c92a4004ccdb1e2fdaa5929b17c9dc3b400831f;p=mesa.git freedreno/a4xx: restore pitch to bytes change to layout code I lost this change when rebasing the commit moving this. Fixes: aa2186db0 ("freedreno: move a4xx specific layout code to a4xx code") Signed-off-by: Jonathan Marek Part-of: --- diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_resource.c b/src/gallium/drivers/freedreno/a4xx/fd4_resource.c index f0c4de9b316..04b812ebf43 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_resource.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_resource.c @@ -47,10 +47,10 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format forma uint32_t blocks; if (layout == UTIL_FORMAT_LAYOUT_ASTC) - slice->pitch = width = - util_align_npot(width, pitchalign * util_format_get_blockwidth(format)); + width = util_align_npot(width, pitchalign * util_format_get_blockwidth(format)); else - slice->pitch = width = align(width, pitchalign); + width = align(width, pitchalign); + slice->pitch = util_format_get_nblocksx(format, width) * rsc->layout.cpp; slice->offset = size; blocks = util_format_get_nblocks(format, width, height); /* 1d array and 2d array textures must all have the same layer size