summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/glcpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-05-01 16:35:34 -0700
committerEric Anholt <[email protected]>2017-05-08 12:15:49 -0700
commite5ade7db73ce209f4f23f8c9d1272575fe990b14 (patch)
tree7b02e0712f72f9b1976f465d0ff6080d0b64729f /src/compiler/glsl/glcpp
parentefa9750e96cc80ff76e0082063da37be53c07a12 (diff)
glsl: Ban #undefining __LINE__ and friends on GLES2.
Fixes deqp_gles2 undefine_invalid_object_* failures. Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glcpp')
-rw-r--r--src/compiler/glsl/glcpp/glcpp-parse.y7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/compiler/glsl/glcpp/glcpp-parse.y b/src/compiler/glsl/glcpp/glcpp-parse.y
index e113253061f..5cb2a380605 100644
--- a/src/compiler/glsl/glcpp/glcpp-parse.y
+++ b/src/compiler/glsl/glcpp/glcpp-parse.y
@@ -284,7 +284,8 @@ control_line_success:
* It is an error to undefine or to redefine a built-in
* (pre-defined) macro name.
*
- * The GLSL ES 1.00 spec does not contain this text.
+ * The GLSL ES 1.00 spec does not contain this text, but
+ * dEQP's preprocess test in GLES2 checks for it.
*
* Section 3.3 (Preprocessor) of the GLSL 1.30 spec says:
*
@@ -296,12 +297,8 @@ control_line_success:
* Furthermore, there are desktop OpenGL conformance tests
* that expect '#undef __VERSION__' and '#undef
* GL_core_profile' to work.
- *
- * Only disallow #undef of pre-defined macros on GLSL ES >=
- * 3.00 shaders.
*/
if (parser->is_gles &&
- parser->version >= 300 &&
(strcmp("__LINE__", $3) == 0
|| strcmp("__FILE__", $3) == 0
|| strcmp("__VERSION__", $3) == 0