diff options
author | marha <marha@users.sourceforge.net> | 2011-02-01 10:02:38 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-02-01 10:02:38 +0000 |
commit | 0bf07d32cbd460220c67d726900772cf3692746d (patch) | |
tree | ba6b1e1937e42744591715078444891d4ade5b1e /mesalib/src/glsl/glsl_parser.ypp | |
parent | cacf23d832a26e35851c9cc666304ac72cf8fe34 (diff) | |
download | vcxsrv-0bf07d32cbd460220c67d726900772cf3692746d.tar.gz vcxsrv-0bf07d32cbd460220c67d726900772cf3692746d.tar.bz2 vcxsrv-0bf07d32cbd460220c67d726900772cf3692746d.zip |
libX11 libXinerama mesa git update 1 Feb 2011
Diffstat (limited to 'mesalib/src/glsl/glsl_parser.ypp')
-rw-r--r-- | mesalib/src/glsl/glsl_parser.ypp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/mesalib/src/glsl/glsl_parser.ypp b/mesalib/src/glsl/glsl_parser.ypp index 3955648eb..d0bebc7fe 100644 --- a/mesalib/src/glsl/glsl_parser.ypp +++ b/mesalib/src/glsl/glsl_parser.ypp @@ -220,25 +220,40 @@ version_statement: /* blank - no #version specified: defaults are already set */ | VERSION INTCONSTANT EOL { + bool supported = false; + switch ($2) { case 100: state->es_shader = true; + supported = state->Const.GLSL_100ES; + break; case 110: + supported = state->Const.GLSL_110; + break; case 120: + supported = state->Const.GLSL_120; + break; case 130: - /* FINISHME: Check against implementation support versions. */ - state->language_version = $2; - state->version_string = - talloc_asprintf(state, "GLSL%s %d.%02d", - state->es_shader ? " ES" : "", - state->language_version / 100, - state->language_version % 100); + supported = state->Const.GLSL_130; break; default: - _mesa_glsl_error(& @2, state, "Shading language version" - "%u is not supported\n", $2); + supported = false; break; } + + state->language_version = $2; + state->version_string = + ralloc_asprintf(state, "GLSL%s %d.%02d", + state->es_shader ? " ES" : "", + state->language_version / 100, + state->language_version % 100); + + if (!supported) { + _mesa_glsl_error(& @2, state, "%s is not supported. " + "Supported versions are: %s\n", + state->version_string, + state->supported_version_string); + } } ; |