summaryrefslogtreecommitdiff
path: root/cogl/driver/gl
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-09-26 22:01:38 +0100
committerRobert Bragg <robert@linux.intel.com>2013-01-20 18:38:23 +0000
commit1aa591e14d481cd377bc2ef7c5da5cff5d1b2717 (patch)
tree0325a6c4a0602d7a7f1f608002975d272af7f71c /cogl/driver/gl
parent27bb48b65f7feecf576c1c5e26e99aa9e9930c15 (diff)
downloadcogl-1aa591e14d481cd377bc2ef7c5da5cff5d1b2717.tar.gz
check the glsl version during init
This adds a check for the glsl version during driver init which gets stored in ctx->glsl_major and ctx->glsl_minor. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 9bde48bda6d602dd536c3536d56d2ff7545802c3)
Diffstat (limited to 'cogl/driver/gl')
-rw-r--r--cogl/driver/gl/gl/cogl-driver-gl.c10
-rw-r--r--cogl/driver/gl/gles/cogl-driver-gles.c3
2 files changed, 13 insertions, 0 deletions
diff --git a/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/driver/gl/gl/cogl-driver-gl.c
index 3bf4de9b..54da229f 100644
--- a/cogl/driver/gl/gl/cogl-driver-gl.c
+++ b/cogl/driver/gl/gl/cogl-driver-gl.c
@@ -375,6 +375,16 @@ _cogl_driver_update_features (CoglContext *ctx,
_cogl_gpu_info_init (ctx, &ctx->gpu);
+ ctx->glsl_major = 1;
+ ctx->glsl_minor = 1;
+
+ if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0))
+ {
+ const char *glsl_version =
+ (char *)ctx->glGetString (GL_SHADING_LANGUAGE_VERSION);
+ parse_gl_version (glsl_version, &ctx->glsl_major, &ctx->glsl_minor);
+ }
+
flags = (COGL_FEATURE_TEXTURE_READ_PIXELS
| COGL_FEATURE_UNSIGNED_INT_INDICES
| COGL_FEATURE_DEPTH_RANGE);
diff --git a/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/driver/gl/gles/cogl-driver-gles.c
index c6d5f50c..6268b4d0 100644
--- a/cogl/driver/gl/gles/cogl-driver-gles.c
+++ b/cogl/driver/gl/gles/cogl-driver-gles.c
@@ -216,6 +216,9 @@ _cogl_driver_update_features (CoglContext *context,
_cogl_gpu_info_init (context, &context->gpu);
+ context->glsl_major = 1;
+ context->glsl_minor = 0;
+
gl_extensions = _cogl_context_get_gl_extensions (context);
_cogl_feature_check_ext_functions (context,