From 88aa3290e96fdce5bfeb97eaa6203eaf4f1d413e Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 4 May 2020 18:10:44 +0100 Subject: [PATCH] tests/gl_basic_test: add apple/core context workaround Based on internet observations, Apple does not expose "(Core Profile)" in the GL_VERSION string. Add a "lovely" warning message + a workaround. Not 100% sure how useful the former is, although it should not be too spammy. Signed-off-by: Emil Velikov --- tests/functional/gl_basic_test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c index 7724e24..52dff64 100644 --- a/tests/functional/gl_basic_test.c +++ b/tests/functional/gl_basic_test.c @@ -488,6 +488,11 @@ gl_basic_draw__(void **state, struct gl_basic_draw_args__ args) switch (context_profile) { case WAFFLE_CONTEXT_CORE_PROFILE: profile_suffix = " (Core Profile)"; +#ifdef __APPLE__ + fprintf(stderr, "MacOS Core contexts, omit the \"%s\" suffix in glGetString(GL_VERSION)." + "Applying workaround.\n", profile_suffix); + profile_suffix = ""; +#endif break; case WAFFLE_CONTEXT_COMPATIBILITY_PROFILE: // HACK: seems like Mesa 19.3.3 at least will report -- 2.11.4.GIT