diff options
author | Carl Worth <[email protected]> | 2012-11-26 15:00:05 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-01-11 10:57:25 -0800 |
commit | 93e719ba4da7c45cdddd276060acbcc1a4edceda (patch) | |
tree | f45b7d6947776b9479237c8ba22cb134ac2887cb /src | |
parent | 77e1bc9f1db315c68d6fd8c1441a678d33ca4db2 (diff) |
glcpp: Make undefined macros illegal in #if and #elif for GLES3
Simply emitting a nicely-formatted error message if any undefined macro is
encountered in a parser context expecting an expression.
With this commit, the following piglit test now passes:
spec/glsl-es-3.00/compiler/undefined-macro.vert
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/glcpp/glcpp-parse.y | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 76dcd42290c..8fba923a2cb 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -363,6 +363,8 @@ integer_constant: expression: integer_constant | IDENTIFIER { + if (parser->is_gles) + glcpp_error(& @1, parser, "undefined macro %s in expression (illegal in GLES)", $1); $$ = 0; } | expression OR expression { |