aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-08-27 10:17:25 +0200
committermarha <marha@users.sourceforge.net>2013-08-27 10:17:25 +0200
commit84e570d071a041f85e2e8b92963d3390d14af5fc (patch)
tree22865391119b41af082d889f8db1f68c23a9c5c4 /mesalib/src/glsl
parent5ee5b91b019005aa27273dff01388a68c12be293 (diff)
downloadvcxsrv-84e570d071a041f85e2e8b92963d3390d14af5fc.tar.gz
vcxsrv-84e570d071a041f85e2e8b92963d3390d14af5fc.tar.bz2
vcxsrv-84e570d071a041f85e2e8b92963d3390d14af5fc.zip
fontconfig mesalib git update 27 aug 2013
fontconfig commit c6228f8091ab91b67ea006ad5a1b1da97b3d4a5a mesa commit d8ac987f6ab228df1a478b36c3d889992754374f
Diffstat (limited to 'mesalib/src/glsl')
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index feff5865a..192130a99 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -1849,9 +1849,18 @@ is_varying_var(ir_variable *var, _mesa_glsl_parser_targets target)
static void
validate_matrix_layout_for_type(struct _mesa_glsl_parse_state *state,
YYLTYPE *loc,
- const glsl_type *type)
+ const glsl_type *type,
+ ir_variable *var)
{
- if (!type->is_matrix()) {
+ if (var && !var->is_in_uniform_block()) {
+ /* Layout qualifiers may only apply to interface blocks and fields in
+ * them.
+ */
+ _mesa_glsl_error(loc, state,
+ "uniform block layout qualifiers row_major and "
+ "column_major may not be applied to variables "
+ "outside of uniform blocks");
+ } else 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
@@ -1922,7 +1931,7 @@ validate_binding_qualifier(struct _mesa_glsl_parse_state *state,
* with an array of size N, all elements of the array from binding
* through binding + N - 1 must be within this range."
*/
- unsigned limit;
+ unsigned limit = 0;
switch (state->target) {
case vertex_shader:
limit = ctx->Const.VertexProgram.MaxTextureImageUnits;
@@ -2302,7 +2311,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
}
if (qual->flags.q.row_major || qual->flags.q.column_major) {
- validate_matrix_layout_for_type(state, loc, var->type);
+ validate_matrix_layout_for_type(state, loc, var->type, var);
}
}
@@ -4476,7 +4485,7 @@ ast_process_structure_or_interface_block(exec_list *instructions,
"row_major and column_major can only be "
"applied to uniform interface blocks");
} else
- validate_matrix_layout_for_type(state, &loc, field_type);
+ validate_matrix_layout_for_type(state, &loc, field_type, NULL);
}
if (qual->flags.q.uniform && qual->has_interpolation()) {