glsl: fix check for matrices in blocks when using nir uniform linker
authorTimothy Arceri <tarceri@itsqueeze.com>
Mon, 13 Jan 2020 00:36:10 +0000 (11:36 +1100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jan 2020 01:02:25 +0000 (01:02 +0000)
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@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3468>

src/compiler/glsl/gl_nir_link_uniforms.c

index efb26caf7ff73fef4e52f6dbb6b5395e9ca863b9..97bd57fc2b8492c3a02d25be85358ac47736ceaa 100644 (file)
@@ -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;
          }