diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2013-08-15 11:24:11 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-08-22 11:50:24 -0700 |
commit | 08b192d26a4478d9004cc02a3b657fd9fd6b6521 (patch) | |
tree | 53cbea0f922d6c45ce20ca1915a2b6e1f2f6f453 | |
parent | c1c076dd8dedc508f225428ff7e3df4094ae3611 (diff) |
glsl: Give a warning, not an error, for UBO qualifiers on non-matrices.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59648
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit dded321f92e4727584a98b71d7aaa15d4f01fb24)
-rw-r--r-- | src/glsl/ast_to_hir.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index b712be4471e..d47468329b1 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -1849,11 +1849,17 @@ 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"); + if (!type->is_matrix()) { + /* The OpenGL ES 3.0 conformance tests did not originally allow + * matrix layout qualifiers on non-matrices. However, the OpenGL + * 4.4 and OpenGL ES 3.0 (revision TBD) specifications were + * amended to specifically allow these layouts on all types. Emit + * a warning so that people know their code may not be portable. + */ + _mesa_glsl_warning(loc, state, + "uniform block layout qualifiers row_major and " + "column_major applied to non-matrix types may " + "be rejected by older compilers"); } 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. @@ -1861,7 +1867,7 @@ validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state, _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 " + "strictly conformant and may be rejected by other " "compilers"); } } |