summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-09-12 10:52:06 +1000
committerTimothy Arceri <[email protected]>2018-09-18 19:34:54 +1000
commit64ec50d52fa691cc1712df1d7eebea90552b7c2e (patch)
tree8d8003d52902314cc05725b076697d9ed0d5622c /src/gallium/state_trackers
parent7a992fcfa059b0db0f07bc3eb38050eaab7aaf34 (diff)
mesa/st: add force_compat_profile option to driconfig
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/dri_context.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index fb307337a90..af9e3325f98 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -62,6 +62,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
__DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR;
const __DRIbackgroundCallableExtension *backgroundCallable =
screen->sPriv->dri2.backgroundCallable;
+ const struct driOptionCache *optionCache = &screen->dev->option_cache;
if (screen->has_reset_status_query) {
allowed_flags |= __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS;
@@ -88,8 +89,13 @@ dri_create_context(gl_api api, const struct gl_config * visual,
break;
case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
- attribs.profile = api == API_OPENGL_COMPAT ? ST_PROFILE_DEFAULT
- : ST_PROFILE_OPENGL_CORE;
+ if (driQueryOptionb(optionCache, "force_compat_profile")) {
+ attribs.profile = ST_PROFILE_DEFAULT;
+ } else {
+ attribs.profile = api == API_OPENGL_COMPAT ? ST_PROFILE_DEFAULT
+ : ST_PROFILE_OPENGL_CORE;
+ }
+
attribs.major = ctx_config->major_version;
attribs.minor = ctx_config->minor_version;