summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-03-08 13:38:31 -0800
committerEric Anholt <[email protected]>2012-03-15 08:33:54 -0700
commitac5a5b324335195b5a5ed98775ce442c573e7e1d (patch)
tree89c8b32d58e110c150b2988316c238d0c5dac2b1 /src
parent99cd475cc9d3bd54140f84c24b55b9e05d7310a1 (diff)
glsl: Add support for parsing #version 140.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/glsl_parser.yy3
-rw-r--r--src/glsl/glsl_parser_extras.cpp2
-rw-r--r--src/glsl/glsl_parser_extras.h1
-rw-r--r--src/mesa/main/getstring.c2
4 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index d5e85abc021..64506b6358a 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -264,6 +264,9 @@ version_statement:
case 130:
supported = state->Const.GLSL_130;
break;
+ case 140:
+ supported = state->Const.GLSL_140;
+ break;
default:
supported = false;
break;
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 2a72ba1f6f9..21c3c6ec2bc 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -94,6 +94,8 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *ctx,
&& (ctx->Const.GLSLVersion >= 120);
this->Const.GLSL_130 = (ctx->API == API_OPENGL)
&& (ctx->Const.GLSLVersion >= 130);
+ this->Const.GLSL_140 = (ctx->API == API_OPENGL)
+ && (ctx->Const.GLSLVersion >= 140);
const unsigned lowest_version =
(ctx->API == API_OPENGLES2) || ctx->Extensions.ARB_ES2_compatibility
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index ee8f71b8280..55676f5a9ec 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -132,6 +132,7 @@ struct _mesa_glsl_parse_state {
unsigned GLSL_110:1;
unsigned GLSL_120:1;
unsigned GLSL_130:1;
+ unsigned GLSL_140:1;
/*@}*/
} Const;
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
index 90e0280552e..2f445aaf97d 100644
--- a/src/mesa/main/getstring.c
+++ b/src/mesa/main/getstring.c
@@ -53,6 +53,8 @@ shading_language_version(struct gl_context *ctx)
return (const GLubyte *) "1.20";
case 130:
return (const GLubyte *) "1.30";
+ case 140:
+ return (const GLubyte *) "1.40";
default:
_mesa_problem(ctx,
"Invalid GLSL version in shading_language_version()");