[Mesa-dev] [PATCH 08/11] glsl: GLSL ES identifiers cannot exceed 1024 characters

Eduardo Lima Mitev elima at igalia.com
Mon Jan 19 03:32:14 PST 2015


From: Iago Toral Quiroga <itoral at igalia.com>

Fixes the following 2 dEQP tests:
dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_vertex
dEQP-GLES3.functional.shaders.keywords.invalid_identifiers.max_length_fragment
---
 src/glsl/glsl_parser.yy | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 7fb8c38..165419c 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -362,6 +362,13 @@ any_identifier:
    IDENTIFIER
    | TYPE_IDENTIFIER
    | NEW_IDENTIFIER
+   {
+      if (state->es_shader && strlen($1) > 1024) {
+         _mesa_glsl_error(& @1, state,
+                          "Identifier `%s' exceeds "
+                          "1024 characters", $1);
+      }
+   }
    ;
 
 extension_statement:
-- 
2.1.3



More information about the mesa-dev mailing list