aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/glsl_parser.ypp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-01 10:46:14 +0000
committermarha <marha@users.sourceforge.net>2011-02-01 10:46:14 +0000
commitd4a8565009962e162d86a9c4ae24062a3fa12025 (patch)
treebcd249c3c523b23a6350b1d6b5a2cff7518cdb0e /mesalib/src/glsl/glsl_parser.ypp
parent6751d9898be671d253d6f7b0806cd4b10daaaf85 (diff)
parent0bf07d32cbd460220c67d726900772cf3692746d (diff)
downloadvcxsrv-d4a8565009962e162d86a9c4ae24062a3fa12025.tar.gz
vcxsrv-d4a8565009962e162d86a9c4ae24062a3fa12025.tar.bz2
vcxsrv-d4a8565009962e162d86a9c4ae24062a3fa12025.zip
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/glsl/glsl_parser.ypp')
-rw-r--r--mesalib/src/glsl/glsl_parser.ypp33
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);
+ }
}
;