Mesa (master): glsl: fix check for matrices in blocks when using nir uniform linker

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 23 01:24:10 UTC 2020


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

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Mon Jan 13 11:36:10 2020 +1100

glsl: fix check for matrices in blocks when using nir uniform linker

We need to stripe any arrays before checking the type. Here we
just use the uniform type which has already be stripped.

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3468>

---

 src/compiler/glsl/gl_nir_link_uniforms.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c
index efb26caf7ff..97bd57fc2b8 100644
--- a/src/compiler/glsl/gl_nir_link_uniforms.c
+++ b/src/compiler/glsl/gl_nir_link_uniforms.c
@@ -554,10 +554,9 @@ nir_link_uniform(struct gl_context *ctx,
          uniform->array_stride = glsl_type_is_array(type) ?
             glsl_get_explicit_stride(type) : 0;
 
-         if (glsl_type_is_matrix(type)) {
-            uniform->matrix_stride = glsl_get_explicit_stride(type);
-
-            uniform->row_major = glsl_matrix_type_is_row_major(type);
+         if (glsl_type_is_matrix(uniform->type)) {
+            uniform->matrix_stride = glsl_get_explicit_stride(uniform->type);
+            uniform->row_major = glsl_matrix_type_is_row_major(uniform->type);
          } else {
             uniform->matrix_stride = 0;
          }



More information about the mesa-commit mailing list