diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/common/dri_util.c | 18 | ||||
-rw-r--r-- | src/mesa/main/version.c | 16 | ||||
-rw-r--r-- | src/mesa/main/version.h | 3 |
3 files changed, 11 insertions, 26 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index d6e875fcfeb..f0e5440c225 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -162,13 +162,17 @@ driCreateNewScreen2(int scrn, int fd, return NULL; } - int gl_version_override = _mesa_get_gl_version_override(); - if (gl_version_override >= 31) { - psp->max_gl_core_version = MAX2(psp->max_gl_core_version, - gl_version_override); - } else { - psp->max_gl_compat_version = MAX2(psp->max_gl_compat_version, - gl_version_override); + struct gl_constants consts = { 0 }; + gl_api api; + int version; + + api = API_OPENGL_COMPAT; + if (_mesa_override_gl_version_contextless(&consts, &api, &version)) { + if (api == API_OPENGL_CORE) { + psp->max_gl_core_version = version; + } else { + psp->max_gl_compat_version = version; + } } psp->api_mask = (1 << __DRI_API_OPENGL); diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index e817e2d92a0..668658fdbf7 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -157,22 +157,6 @@ _mesa_override_gl_version(struct gl_context *ctx) } /** - * Returns the gl override value - * - * version > 0 indicates there is an override requested - */ -int -_mesa_get_gl_version_override(void) -{ - int version; - bool fwd_context, compat_context; - - get_gl_override(&version, &fwd_context, &compat_context); - - return version; -} - -/** * Override the context's GLSL version if the environment variable * MESA_GLSL_VERSION_OVERRIDE is set. Valid values for * MESA_GLSL_VERSION_OVERRIDE are integers, such as "130". diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 450a0e31d3d..ee7cb7501eb 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -47,7 +47,4 @@ _mesa_override_gl_version(struct gl_context *ctx); extern void _mesa_override_glsl_version(struct gl_constants *consts); -extern int -_mesa_get_gl_version_override(void); - #endif /* VERSION_H */ |