glsl: Also track matrix layout information into structures
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 18 Jul 2014 17:27:21 +0000 (10:27 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 4 Aug 2014 21:40:07 +0000 (14:40 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/ast_to_hir.cpp

index 89ac84e6b069003f84eb571203c6ff9bb9926dc5..d5699935e604270ed2be700af12c956b0cda99ce 100644 (file)
@@ -5203,7 +5203,13 @@ ast_process_structure_or_interface_block(exec_list *instructions,
                              "in uniform blocks or structures.");
          }
 
-         if (field_type->without_array()->is_matrix()) {
+         /* Propogate row- / column-major information down the fields of the
+          * structure or interface block.  Structures need this data because
+          * the structure may contain a structure that contains ... a matrix
+          * that need the proper layout.
+          */
+         if (field_type->without_array()->is_matrix()
+             || field_type->without_array()->is_record()) {
             fields[i].matrix_layout = block_row_major
                ? GLSL_MATRIX_LAYOUT_ROW_MAJOR
                : GLSL_MATRIX_LAYOUT_COLUMN_MAJOR;