[Mesa-dev] [PATCH 5/5] mesa: Allow overriding the version of ES2+ contexts

Ian Romanick idr at freedesktop.org
Tue May 26 12:37:05 PDT 2015


From: Ian Romanick <ian.d.romanick at intel.com>

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/drivers/dri/common/dri_util.c | 4 ++++
 src/mesa/main/context.c                | 4 +---
 src/mesa/state_tracker/st_manager.c    | 3 +--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index f0e5440..2d847ef 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -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) {
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index e4faf3d..8a59b5e 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -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);
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 0376954..a2dee62 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -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;
    }
 
-- 
2.1.0



More information about the mesa-dev mailing list