mesa: Allow overriding the version of ES2+ contexts
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 29 Apr 2015 23:12:40 +0000 (16:12 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 28 May 2015 23:56:31 +0000 (16:56 -0700)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/drivers/dri/common/dri_util.c
src/mesa/main/context.c
src/mesa/state_tracker/st_manager.c

index f0e5440c2257f2906023bb07beca0ec783137b2f..2d847ef7bc879ce2b03edcc3ba2f11e20e31691c 100644 (file)
@@ -166,6 +166,10 @@ driCreateNewScreen2(int scrn, int fd,
     gl_api api;
     int version;
 
+    api = API_OPENGLES2;
+    if (_mesa_override_gl_version_contextless(&consts, &api, &version))
+       psp->max_gl_es2_version = version;
+
     api = API_OPENGL_COMPAT;
     if (_mesa_override_gl_version_contextless(&consts, &api, &version)) {
        if (api == API_OPENGL_CORE) {
index e4faf3d462a618b868083e2159e02a5e26964ee9..8a59b5ed42fd7a50ebaa3da668fbb0a77088b1d6 100644 (file)
@@ -1169,9 +1169,7 @@ _mesa_initialize_context(struct gl_context *ctx,
       ctx->HasConfig = GL_FALSE;
    }
 
-   if (_mesa_is_desktop_gl(ctx)) {
-      _mesa_override_gl_version(ctx);
-   }
+   _mesa_override_gl_version(ctx);
 
    /* misc one-time initializations */
    one_time_init(ctx);
index 0376954f74260fb75792853f3ff3d667e40ca1e5..a2dee6298faeb4801f010f0da12289ad8a771b8b 100644 (file)
@@ -924,8 +924,7 @@ static unsigned get_version(struct pipe_screen *screen,
    struct gl_extensions extensions = {0};
    GLuint version;
 
-   if ((api == API_OPENGL_COMPAT || api == API_OPENGL_CORE) &&
-       _mesa_override_gl_version_contextless(&consts, &api, &version)) {
+   if (_mesa_override_gl_version_contextless(&consts, &api, &version)) {
       return version;
    }