Mesa (master): freedreno/a4xx: restore pitch to bytes change to layout code

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jun 21 22:03:32 UTC 2020


Module: Mesa
Branch: master
Commit: 6c92a4004ccdb1e2fdaa5929b17c9dc3b400831f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6c92a4004ccdb1e2fdaa5929b17c9dc3b400831f

Author: Jonathan Marek <jonathan at marek.ca>
Date:   Fri May 22 10:12:02 2020 -0400

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 <jonathan at marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5132>

---

 src/gallium/drivers/freedreno/a4xx/fd4_resource.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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



More information about the mesa-commit mailing list