dri_util: Use _mesa_override_gl_version_contextless
Remove _mesa_get_gl_version_override. We don't need two functions that do basically the same thing. This change seemed easier (esp. with the next patch) than going the other way. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
@@ -162,13 +162,17 @@ driCreateNewScreen2(int scrn, int fd,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gl_version_override = _mesa_get_gl_version_override();
|
struct gl_constants consts = { 0 };
|
||||||
if (gl_version_override >= 31) {
|
gl_api api;
|
||||||
psp->max_gl_core_version = MAX2(psp->max_gl_core_version,
|
int version;
|
||||||
gl_version_override);
|
|
||||||
} else {
|
api = API_OPENGL_COMPAT;
|
||||||
psp->max_gl_compat_version = MAX2(psp->max_gl_compat_version,
|
if (_mesa_override_gl_version_contextless(&consts, &api, &version)) {
|
||||||
gl_version_override);
|
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);
|
psp->api_mask = (1 << __DRI_API_OPENGL);
|
||||||
|
|||||||
@@ -156,22 +156,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
|
* Override the context's GLSL version if the environment variable
|
||||||
* MESA_GLSL_VERSION_OVERRIDE is set. Valid values for
|
* MESA_GLSL_VERSION_OVERRIDE is set. Valid values for
|
||||||
|
|||||||
@@ -47,7 +47,4 @@ _mesa_override_gl_version(struct gl_context *ctx);
|
|||||||
extern void
|
extern void
|
||||||
_mesa_override_glsl_version(struct gl_constants *consts);
|
_mesa_override_glsl_version(struct gl_constants *consts);
|
||||||
|
|
||||||
extern int
|
|
||||||
_mesa_get_gl_version_override(void);
|
|
||||||
|
|
||||||
#endif /* VERSION_H */
|
#endif /* VERSION_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user