After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781398 - GLES 2 build is broken
GLES 2 build is broken
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-04-17 11:18 UTC by Mario Sánchez Prada
Modified: 2017-04-17 12:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Define new tokens from the ARB_robustness extension if needed (1.48 KB, patch)
2017-04-17 11:40 UTC, Mario Sánchez Prada
committed Details | Review
Consider the right CONTEXT_LOST token on OpenGL ES contexts (1.21 KB, patch)
2017-04-17 11:41 UTC, Mario Sánchez Prada
none Details | Review
Consider the right CONTEXT_LOST token on OpenGL ES contexts (1.21 KB, patch)
2017-04-17 11:48 UTC, Mario Sánchez Prada
committed Details | Review

Description Mario Sánchez Prada 2017-04-17 11:18:44 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
Comment 1 Mario Sánchez Prada 2017-04-17 11:40:52 UTC
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
Comment 2 Mario Sánchez Prada 2017-04-17 11:41:14 UTC
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 3 Mario Sánchez Prada 2017-04-17 11:47:17 UTC
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
Comment 4 Mario Sánchez Prada 2017-04-17 11:48:26 UTC
Created attachment 349940 [details] [review]
Consider the right CONTEXT_LOST token on OpenGL ES contexts

Silly mistake in the previous patch. Fixing
Comment 5 Emmanuele Bassi (:ebassi) 2017-04-17 11:55:27 UTC
Review of attachment 349938 [details] [review]:

Looks good.
Comment 6 Emmanuele Bassi (:ebassi) 2017-04-17 11:56:23 UTC
Review of attachment 349940 [details] [review]:

Looks good.