Mesa (master): freedreno/a6xx: Fix use of uninitialized img->level in the SSBO/image path.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Nov 18 18:31:18 UTC 2020
Module: Mesa
Branch: master
Commit: 530a32bb9593704cec291b613e75b91ecdfd6aa4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=530a32bb9593704cec291b613e75b91ecdfd6aa4
Author: Eric Anholt <eric at anholt.net>
Date: Tue Nov 17 12:24:01 2020 -0800
freedreno/a6xx: Fix use of uninitialized img->level in the SSBO/image path.
I think enough things lined up that the uninitialized level in the buffer
paths would end effectively not being used (no ubwc, not tiling anyway),
but let's just zero-init it to be sure and quiet the compiler.
Reviewed-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7664>
---
src/gallium/drivers/freedreno/a6xx/fd6_image.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_image.c b/src/gallium/drivers/freedreno/a6xx/fd6_image.c
index 128a15ef21b..1639a6bcf10 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_image.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_image.c
@@ -91,6 +91,7 @@ static void translate_image(struct fd6_image *img, const struct pipe_image_view
img->width = sz & MASK(15);
img->height = sz >> 15;
img->depth = 0;
+ img->level = 0;
} else {
img->buffer = false;
@@ -155,6 +156,7 @@ static void translate_buf(struct fd6_image *img, const struct pipe_shader_buffer
img->offset = pimg->buffer_offset;
img->pitch = 0;
img->array_pitch = 0;
+ img->level = 0;
/* size is encoded with low 15b in WIDTH and high bits in HEIGHT,
* in units of elements:
More information about the mesa-commit
mailing list