Mesa (master): nir/lower_images: fix for array of arrays

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 18 15:39:52 UTC 2020


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

Author: Karol Herbst <kherbst at redhat.com>
Date:   Mon Jun 15 18:29:58 2020 +0200

nir/lower_images: fix for array of arrays

Signed-off-by: Karol Herbst <kherbst at redhat.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5480>

---

 src/compiler/glsl/gl_nir_lower_images.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/gl_nir_lower_images.c b/src/compiler/glsl/gl_nir_lower_images.c
index 5b51c3aa03c..265206a012a 100644
--- a/src/compiler/glsl/gl_nir_lower_images.c
+++ b/src/compiler/glsl/gl_nir_lower_images.c
@@ -39,8 +39,15 @@
 static void
 type_size_align_1(const struct glsl_type *type, unsigned *size, unsigned *align)
 {
-   *size = 1;
-   *align = 1;
+   unsigned s;
+
+   if (glsl_type_is_array(type))
+      s = glsl_get_aoa_size(type);
+   else
+      s = 1;
+
+   *size = s;
+   *align = s;
 }
 
 static bool



More information about the mesa-commit mailing list