From eee9247018d710659f14678715a85e4ad6f54366 Mon Sep 17 00:00:00 2001 From: Jose Fonseca Date: Tue, 16 Jun 2015 15:32:46 -0600 Subject: [PATCH] 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 --- 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 2ed6c2bfac9..3e99cc44db7 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) { -- 2.30.2