summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser_extras.cpp
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2012-07-24 14:48:57 -0700
committerJordan Justen <[email protected]>2012-07-30 16:25:56 -0700
commit4aecd8f0316833348bb6fc392eb1aeea2410a206 (patch)
tree2e4e6ebbaf0568e0efa88ded3a3d7e640addbe47 /src/glsl/glsl_parser_extras.cpp
parent09714c09a40501d82823e42f7461d7b8d7bf11c0 (diff)
glsl: add support for using API_OPENGL_CORE
Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/glsl_parser_extras.cpp')
-rw-r--r--src/glsl/glsl_parser_extras.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index df4045938ce..7a9b22197f0 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -27,6 +27,7 @@
extern "C" {
#include "main/core.h" /* for struct gl_context */
+#include "main/context.h"
}
#include "ralloc.h"
@@ -90,19 +91,17 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
*/
this->Const.GLSL_100ES = (ctx->API == API_OPENGLES2)
|| ctx->Extensions.ARB_ES2_compatibility;
- this->Const.GLSL_110 = (ctx->API == API_OPENGL);
- this->Const.GLSL_120 = (ctx->API == API_OPENGL)
- && (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);
+ bool is_desktop_gl = _mesa_is_desktop_gl(ctx);
+ this->Const.GLSL_110 = is_desktop_gl;
+ this->Const.GLSL_120 = is_desktop_gl && (ctx->Const.GLSLVersion >= 120);
+ this->Const.GLSL_130 = is_desktop_gl && (ctx->Const.GLSLVersion >= 130);
+ this->Const.GLSL_140 = is_desktop_gl && (ctx->Const.GLSLVersion >= 140);
const unsigned lowest_version =
(ctx->API == API_OPENGLES2) || ctx->Extensions.ARB_ES2_compatibility
? 100 : 110;
const unsigned highest_version =
- (ctx->API == API_OPENGL) ? ctx->Const.GLSLVersion : 100;
+ is_desktop_gl ? ctx->Const.GLSLVersion : 100;
char *supported = ralloc_strdup(this, "");
for (unsigned ver = lowest_version; ver <= highest_version; ver += 10) {