Mesa (master): freedreno/a6xx: Fix the size of buffer image views.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 26 18:34:08 UTC 2020


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

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan 21 15:16:56 2020 -0800

freedreno/a6xx: Fix the size of buffer image views.

We were using the size of the underlying buffer (in R8 elements), while we
need to be using the size of the image view (which may be a subset of the
underlying buffer, and may be in a different format from R8).

This fix means less dereferencing off of the end of shader image views for
buffer images, but more importantly is needed to get the right answer from
resinfo if we are to switch to that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>

---

 src/gallium/drivers/freedreno/a6xx/fd6_image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_image.c b/src/gallium/drivers/freedreno/a6xx/fd6_image.c
index a83d080fa5b..6098799e22d 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_image.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_image.c
@@ -89,7 +89,7 @@ static void translate_image(struct fd6_image *img, const struct pipe_image_view
 		/* size is encoded with low 15b in WIDTH and high bits in
 		 * HEIGHT, in units of elements:
 		 */
-		unsigned sz = prsc->width0;
+		unsigned sz = pimg->u.buf.size / util_format_get_blocksize(format);
 		img->width  = sz & MASK(15);
 		img->height = sz >> 15;
 		img->depth  = 0;



More information about the mesa-commit mailing list