GNOME Bugzilla – Bug 781398
GLES 2 build is broken
Last modified: 2017-04-17 12:00:31 UTC
As mentioned in https://bugzilla.gnome.org/show_bug.cgi?id=739178#c150, the following two commits broke the build when using the GLES2 driver, as neither GL_CONTEXT_LOST nor GL_GUILTY_CONTEXT_RESET_ARB are defined in the headers (at least not in the headers provided by mesa 13.0.4): * cogl: Ignore GL_CONTEXT_LOST when checking for GL errors https://git.gnome.org/browse/mutter/commit/?id=d4d2bf0f6c1737256b921c4f1dedd3a95138cab9 * cogl-context: Add a cogl_get_graphics_reset_status API https://git.gnome.org/browse/mutter/commit/?id=0f2be43af479f5bae41b00fc857324b27550e410 I'll be posting patches for this issue soon
Created attachment 349938 [details] [review] Define new tokens from the ARB_robustness extension if needed The ARB_robustness extension defined the following tokens as returned by GetGraphicsResetStatusARB (see spec at [1]): GUILTY_CONTEXT_RESET_ARB 0x8253 INNOCENT_CONTEXT_RESET_ARB 0x8254 UNKNOWN_CONTEXT_RESET_ARB 0x8255 These tokens might not be defined in some GL implementations, such as Mesa 13's implementation of GLES 2.0, so we need to define them ourselves not to break those builds. [1] https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_robustness.txt
Created attachment 349939 [details] [review] Consider the right CONTEXT_LOST token on OpenGL ES contexts The KHR_robustness extension defined the following token as returned by GetError (see spec at [1]): CONTEXT_LOST 0x0507 As noted in the spec, this token must have a "_KHR" suffix in an OpenGL ES context, which is not being considered here, thus making this type of builds fail. [1] https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_robustness.txt
Comment on attachment 349939 [details] [review] Consider the right CONTEXT_LOST token on OpenGL ES contexts >From a0b35dd338d585cf092df49aad8639b9dcc0909d Mon Sep 17 00:00:00 2001 >From: Mario Sanchez Prada <mario@endlessm.com> >Date: Mon, 17 Apr 2017 12:27:59 +0100 >Subject: [PATCH] Consider the right CONTEXT_LOST token on OpenGL ES contexts > >The KHR_robustness extension defined the following token as >returned by GetError (see spec at [1]): > > CONTEXT_LOST 0x0507 > >As noted in the spec, this token must have a "_KHR" suffix in >an OpenGL ES context, which is not being considered here, thus >making this type of builds fail. > >[1] https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_robustness.txt > >https://bugzilla.gnome.org/show_bug.cgi?id=781398 >--- > cogl/cogl/driver/gl/cogl-util-gl-private.h | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/cogl/cogl/driver/gl/cogl-util-gl-private.h b/cogl/cogl/driver/gl/cogl-util-gl-private.h >index 1407e0f..74db6ee 100644 >--- a/cogl/cogl/driver/gl/cogl-util-gl-private.h >+++ b/cogl/cogl/driver/gl/cogl-util-gl-private.h >@@ -37,6 +37,11 @@ > #include "cogl-gl-header.h" > #include "cogl-texture.h" > >+/* In OpenGL ES context, GL_CONTEXT_LOST has a _KHR prefix */ >+#ifndef GL_CONTEXT_LOST >+#define GL_CONTEXT_LOST GL_CONTEXT_LOST_KHR >+#endif >+ > #ifdef COGL_GL_DEBUG > > const char * >-- >2.9.3
Created attachment 349940 [details] [review] Consider the right CONTEXT_LOST token on OpenGL ES contexts Silly mistake in the previous patch. Fixing
Review of attachment 349938 [details] [review]: Looks good.
Review of attachment 349940 [details] [review]: Looks good.
Thanks for the review. Now committed: https://git.gnome.org/browse/mutter/commit/?id=e435cf301f78971f3d4965468f53ccad7ab1b2f8 https://git.gnome.org/browse/mutter/commit/?id=229ac9c9dcc9fe8a1462c742ba1776e090bc37a1