Mesa (master): st/wgl: Don't return core profile for 3.1 contexts.

Brian Paul brianp at kemper.freedesktop.org
Fri Jun 19 17:21:40 UTC 2015


Module: Mesa
Branch: master
Commit: eee9247018d710659f14678715a85e4ad6f54366
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eee9247018d710659f14678715a85e4ad6f54366

Author: Jose Fonseca <jfonseca at vmware.com>
Date:   Tue Jun 16 15:32:46 2015 -0600

st/wgl: Don't return core profile for 3.1 contexts.

WGL_CONTEXT_PROFILE_MASK_ARB doesn't apply to desktop OpenGL versions
less than 3.2 -- applications can't specify whether they want a core or
a compat 3.1 context -- instead they are supposed the check whether the
returned context advertises GL_ARB_compatibility extension.

Mesa doesn't support compatability contexts for version higher than 3.1,
so we used to return core profile context, but this makes several Windows
applications unhappy, because they just assume they got a compatability
context without checking.

So it seems safer to on Windows to never return core profile for 3.1,
ie, just fail the context creation.

VMware PR1365920.

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/state_trackers/wgl/stw_context.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c
index 2ed6c2b..3e99cc4 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -226,14 +226,13 @@ stw_create_context_attribs(HDC hdc, INT iLayerPlane, DHGLRC hShareContext,
        *         be implemented, as determined by the implementation.
        *       * The core profile of version 3.2 or greater."
        *
-       * and because Mesa doesn't support GL_ARB_compatibility, the only chance to
-       * honour a 3.1 context is through core profile.
+       * But Mesa doesn't support GL_ARB_compatibility, while most prevalent
+       * Windows OpenGL implementations do, and unfortunately many Windows
+       * applications don't check whether they receive or not a context with
+       * GL_ARB_compatibility, so returning a core profile here does more harm
+       * than good.
        */
-      if (majorVersion == 3 && minorVersion == 1) {
-         attribs.profile = ST_PROFILE_OPENGL_CORE;
-      } else {
-         attribs.profile = ST_PROFILE_DEFAULT;
-      }
+      attribs.profile = ST_PROFILE_DEFAULT;
       break;
    case WGL_CONTEXT_ES_PROFILE_BIT_EXT:
       if (majorVersion >= 2) {




More information about the mesa-commit mailing list