[Mesa-dev] [PATCH 04/11] glsl: interface blocks must be declared at global scope
Eduardo Lima Mitev
elima at igalia.com
Mon Jan 19 03:32:10 PST 2015
From: Iago Toral Quiroga <itoral at igalia.com>
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
---
src/glsl/ast_to_hir.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 2b67e14..678638d 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -5391,6 +5391,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.
--
2.1.3
More information about the mesa-dev
mailing list