diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index bfd5fda..a6d23ab 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1825,31 +1825,6 @@ is_varying_var(ir_variable *var, _mesa_glsl_parser_targets target) } -/** - * Matrix layout qualifiers are only allowed on certain types - */ -static void -validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state, - YYLTYPE *loc, - const glsl_type *type) -{ - if (!type->is_matrix() && !type->is_record()) { - _mesa_glsl_error(loc, state, - "uniform block layout qualifiers row_major and " - "column_major can only be applied to matrix and " - "structure types"); - } else if (type->is_record()) { - /* We allow 'layout(row_major)' on structure types because it's the only - * way to get row-major layouts on matrices contained in structures. - */ - _mesa_glsl_warning(loc, state, - "uniform block layout qualifiers row_major and " - "column_major applied to structure types is not " - "strictly conformant and my be rejected by other " - "compilers"); - } -} - static bool validate_binding_qualifier(struct _mesa_glsl_parse_state *state, YYLTYPE *loc, @@ -2256,8 +2231,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, "uniform block layout qualifiers row_major and " "column_major can only be applied to uniform block " "members"); - } else - validate_matrix_layout_for_type(state, loc, var->type); + } } } @@ -4209,13 +4183,7 @@ ast_process_structure_or_interface_block(exec_list *instructions, _mesa_glsl_error(&loc, state, "row_major and column_major can only be " "applied to uniform interface blocks."); - } else if (!field_type->is_matrix() && !field_type->is_record()) { - _mesa_glsl_error(&loc, state, - "uniform block layout qualifiers row_major and " - "column_major can only be applied to matrix and " - "structure types"); - } else - validate_matrix_layout_for_type(state, &loc, field_type); + } } if (qual->flags.q.uniform && qual->has_interpolation()) {