summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2014-05-07 13:10:40 +0100
committerJosé Fonseca <[email protected]>2014-05-07 16:15:45 +0100
commitaee501060bec7ef548a37f6a7676c51eb67bf882 (patch)
treebdb133b1b628b6b25673ef6bbc826e5f899cf5e3 /src/gallium/state_trackers
parent9701c6984d8d6570d90a15f86872b16bdba117f2 (diff)
st/wgl: Honour request of 3.1 contexts through core profile where available.
Port 5f493eed69f6fb11239c04119d602f1c23a68cbd from GLX. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/wgl/stw_context.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c
index 3a93091ac38..43186fa2690 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -205,10 +205,23 @@ stw_create_context_attribs(
*
* "The default value for WGL_CONTEXT_PROFILE_MASK_ARB is
* WGL_CONTEXT_CORE_PROFILE_BIT_ARB."
+ *
+ * The spec also says:
+ *
+ * "If version 3.1 is requested, the context returned may implement
+ * any of the following versions:
+ *
+ * * Version 3.1. The GL_ARB_compatibility extension may or may not
+ * 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.
*/
attribs.profile = ST_PROFILE_DEFAULT;
- if ((majorVersion > 3 || (majorVersion == 3 && minorVersion >= 2))
- && ((profileMask & WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB) == 0))
+ if (((majorVersion > 3 || (majorVersion == 3 && minorVersion >= 2))
+ && ((profileMask & WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB) == 0)) ||
+ (majorVersion == 3 && minorVersion == 1))
attribs.profile = ST_PROFILE_OPENGL_CORE;
ctx->st = stw_dev->stapi->create_context(stw_dev->stapi,