glsl: can't have 'const' qualifier used with struct or interface block members
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 19 Jan 2015 11:32:12 +0000 (12:32 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 3 Feb 2015 12:19:36 +0000 (13:19 +0100)
Fixes the following 2 dEQP tests:
dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_const_vertex
dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_const_fragment

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast_to_hir.cpp

index c2c9f0653e8d89e7e8254937af7a7685c0724989..ed0eb0982dd280cb8487b2ee6226992bf5f1d2ee 100644 (file)
@@ -5201,6 +5201,13 @@ ast_process_structure_or_interface_block(exec_list *instructions,
                              "members");
          }
 
+         if (qual->flags.q.constant) {
+            YYLTYPE loc = decl_list->get_location();
+            _mesa_glsl_error(&loc, state,
+                             "const storage qualifier cannot be applied "
+                             "to struct or interface block members");
+         }
+
          field_type = process_array_type(&loc, decl_type,
                                          decl->array_specifier, state);
          fields[i].type = field_type;