[Mesa-dev] [PATCH] glsl: Consider "__" in identifers as reserved in GLSL 1.30+.

Eric Anholt eric at anholt.net
Mon Oct 3 16:51:26 PDT 2011


---
 src/glsl/ast_to_hir.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 91a2231..99ca321 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2803,6 +2803,12 @@ ast_declarator_list::hir(exec_list *instructions,
 	    _mesa_glsl_error(& loc, state,
 			     "identifier `%s' uses reserved `gl_' prefix",
 			     decl->identifier);
+	 else if (state->language_version >= 130 &&
+		  strstr(decl->identifier, "__")) {
+	    _mesa_glsl_error(& loc, state,
+			     "identifier `%s' uses reserved `__' string",
+			     decl->identifier);
+	 }
 
 	 /* Add the variable to the symbol table.  Note that the initializer's
 	  * IR was already processed earlier (though it hasn't been emitted
-- 
1.7.6.3



More information about the mesa-dev mailing list