From c6067fcd0747c85dee333b9b5726fc7fec998c1b Mon Sep 17 00:00:00 2001 From: Andres Gomez Date: Sat, 3 Mar 2018 00:55:46 +0200 Subject: dri_util: don't fail when not supporting ARB_compatibility with GL3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, any driver that does not support the ARB_compatibility extension will fail on GL3.1 context creation if the application does not request the forward-compatiblity flag. Restore the original check which changes mesa_api to API_OPENGL_CORE, only when: - GL3.1 is requested, without the forward-compatiblity flag. - driver does not support ARB_compatibility - as deduced by max_gl_compat_version. Fixes: a0c8b49284e ("mesa: enable OpenGL 3.1 with ARB_compatibility") v2: - Improve commit log (Emil). - Provide a correct explanation on the features documentation (Ian). Cc: Marek Olšák Cc: Ian Romanick Cc: Kenneth Graunke Cc: Eric Engestrom Cc: Emil Velikov Signed-off-by: Andres Gomez Reviewed-by: Emil Velikov Reviewed-by: Marek Olšák --- src/mesa/drivers/dri/common/dri_util.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 3f780d155b8..0b94d19fa5d 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -379,6 +379,16 @@ driCreateContextAttribs(__DRIscreen *screen, int api, } } + /* The specific Mesa driver may not support the GL_ARB_compatibilty + * extension or the compatibility profile. In that case, we treat an + * API_OPENGL_COMPAT 3.1 as API_OPENGL_CORE. We reject API_OPENGL_COMPAT + * 3.2+ in any case. + */ + if (mesa_api == API_OPENGL_COMPAT && + ctx_config.major_version == 3 && ctx_config.minor_version == 1 && + screen->max_gl_compat_version < 31) + mesa_api = API_OPENGL_CORE; + if (mesa_api == API_OPENGL_COMPAT && ((ctx_config.major_version > 3) || (ctx_config.major_version == 3 && -- cgit v1.2.3