Mesa (staging/18.2): mesa/st: add force_compat_profile option to driconfig

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 11 08:26:14 UTC 2018


Module: Mesa
Branch: staging/18.2
Commit: 50727810edc6d8341435b95392d05128d957bcfb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=50727810edc6d8341435b95392d05128d957bcfb

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Sat Oct  6 11:00:02 2018 +1000

mesa/st: add force_compat_profile option to driconfig

---

 src/gallium/auxiliary/pipe-loader/driinfo_gallium.h |  1 +
 src/gallium/state_trackers/dri/dri_context.c        | 10 ++++++++--
 src/util/xmlpool/t_options.h                        |  5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
index 90dbf658a6..284e07386d 100644
--- a/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
+++ b/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h
@@ -30,6 +30,7 @@ DRI_CONF_SECTION_DEBUG
    DRI_CONF_ALLOW_HIGHER_COMPAT_VERSION("false")
    DRI_CONF_FORCE_GLSL_ABS_SQRT("false")
    DRI_CONF_GLSL_CORRECT_DERIVATIVES_AFTER_DISCARD("false")
+   DRI_CONF_FORCE_COMPAT_PROFILE("false")
 DRI_CONF_SECTION_END
 
 DRI_CONF_SECTION_MISCELLANEOUS
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index fb307337a9..af9e3325f9 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;
 
diff --git a/src/util/xmlpool/t_options.h b/src/util/xmlpool/t_options.h
index f0537e965b..7d21750f6b 100644
--- a/src/util/xmlpool/t_options.h
+++ b/src/util/xmlpool/t_options.h
@@ -150,6 +150,11 @@ DRI_CONF_OPT_BEGIN_B(allow_glsl_cross_stage_interpolation_mismatch, def) \
         DRI_CONF_DESC(en,gettext("Allow interpolation qualifier mismatch across shader stages")) \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_FORCE_COMPAT_PROFILE(def) \
+DRI_CONF_OPT_BEGIN_B(force_compat_profile, def) \
+        DRI_CONF_DESC(en,gettext("Force an OpenGL compatibility context")) \
+DRI_CONF_OPT_END
+
 /**
  * \brief Image quality-related options
  */




More information about the mesa-commit mailing list