mesa/src
Ian Romanick 0c25b3e4b0 glcpp: Only disallow #undef of pre-defined macros on GLSL ES >= 3.00 shaders
Section 3.4 (Preprocessor) of the GLSL ES 3.00 spec says:

   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.

Section 3.3 (Preprocessor) of the GLSL 1.30 spec says:

   #define and #undef functionality are defined as is standard for C++
   preprocessors for macro definitions both with and without macro
   parameters.

At least as far as I can tell GCC allow '#undef __FILE__'.  Furthermore,
there are desktop OpenGL conformance tests that expect '#undef
__VERSION__' and '#undef GL_core_profile' to work.

Fixes:

    GL45-CTS.shaders.preprocessor.definitions.undefine_version_vertex
    GL45-CTS.shaders.preprocessor.definitions.undefine_version_fragment
    GL45-CTS.shaders.preprocessor.definitions.undefine_core_profile_vertex
    GL45-CTS.shaders.preprocessor.definitions.undefine_core_profile_fragment

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 50b49d242d)

Squashed with commit

glcpp: Update tests for new #undef of built-in macro rules.

Ian recently changed the preprocessor to allow this in most GLSL
versions, but not GLSL ES 3.00+.  This patch converts the existing
test that expects a failure to a #version 300 es shader, and adds
a #version 110 shader to make sure that it's allowed.

Fixes 'make check'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97307
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit 1f47f78fc3)
2016-09-01 11:39:29 +01:00
..
compiler glcpp: Only disallow #undef of pre-defined macros on GLSL ES >= 3.00 shaders 2016-09-01 11:39:29 +01:00
egl egl/dri2: Add reference count for dri2_egl_display 2016-09-01 10:05:40 +01:00
gallium radeonsi: only set dual source blending for MRT0 2016-09-01 10:06:23 +01:00
gbm gbm: remove define _DEFAULT_SOURCE 2016-05-23 12:09:11 +01:00
getopt
glx Avoid overflow in 'last' variable of FindGLXFunction(...) 2016-07-21 14:31:27 +01:00
gtest
hgl
intel anv/gen7_pipeline: Set PixelShaderKillPixel for discards 2016-09-01 10:06:23 +01:00
loader loader: fix memory leak in loader_dri3_open 2016-09-01 10:06:23 +01:00
mapi mapi: Massage code to allow clang to compile. 2016-07-27 11:07:53 +01:00
mesa i965/vec4: Make opt_vector_float reset at the top of each block 2016-09-01 10:06:24 +01:00
util mesa: Add .gitignore entries for make check binaries 2016-05-25 09:41:44 -07:00
Makefile.am automake: don't mandate git_sha1.h/MESA_GIT_SHA1 2016-07-07 16:12:33 +01:00
SConscript glsl: move to compiler/ 2016-01-26 16:08:33 +00:00