aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2015-01-19 12:32:10 +0100
committerIago Toral Quiroga <[email protected]>2015-02-03 13:19:36 +0100
commit5d655a43e606e7eb7ef09af60d2b8896f271e0de (patch)
tree8520ec907e2f2492289acfe5e1dd5ffc73a11cc0 /src/glsl
parent6dd346c2328df86f843c3a355a7919fb0404f6df (diff)
glsl: interface blocks must be declared at global scope
Fixes the following 2 dEQP tests: dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_in_main_vertex dEQP-GLES3.functional.shaders.declarations.invalid_declarations.uniform_block_in_main_fragment Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r--src/glsl/ast_to_hir.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 4d28069a1cc..c2c9f0653e8 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -5381,6 +5381,14 @@ ast_interface_block::hir(exec_list *instructions,
{
YYLTYPE loc = this->get_location();
+ /* Interface blocks must be declared at global scope */
+ if (state->current_function != NULL) {
+ _mesa_glsl_error(&loc, state,
+ "Interface block `%s' must be declared "
+ "at global scope",
+ this->block_name);
+ }
+
/* The ast_interface_block has a list of ast_declarator_lists. We
* need to turn those into ir_variables with an association
* with this uniform block.