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 742953 - GdkGLContext will not create a core context
GdkGLContext will not create a core context
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
3.15.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 743139 743144 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-01-15 05:27 UTC by Niels Nesse
Modified: 2015-02-06 04:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed fix for bug (5.06 KB, patch)
2015-01-15 05:37 UTC, Niels Nesse
committed Details | Review

Description Niels Nesse 2015-01-15 05:27:26 UTC
A recent change removed the version number attributes from the core context creation command which resulted in legacy contexts being created instead. A suggested fix is attached. Only adding back the version attributes breaks GL composition/painting code because several calls made there are not compatible with core GL contexts. The attached patch also removes these compatibility profile calls.
Comment 1 Niels Nesse 2015-01-15 05:37:18 UTC
Created attachment 294570 [details] [review]
Proposed fix for bug
Comment 2 Matthias Clasen 2015-01-15 15:19:44 UTC
Review of attachment 294570 [details] [review]:

::: gdk/x11/gdkglcontext-x11.c
@@ +754,3 @@
     GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+    GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+    GLX_CONTEXT_MINOR_VERSION_ARB, 2,

We had this before. It was removed because it breaks GL rendering. Emmanuele was going to investigate whats wrong in mesa to cause that.
Comment 3 Matthias Clasen 2015-01-15 15:19:47 UTC
Review of attachment 294570 [details] [review]:

::: gdk/x11/gdkglcontext-x11.c
@@ +754,3 @@
     GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
+    GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
+    GLX_CONTEXT_MINOR_VERSION_ARB, 2,

We had this before. It was removed because it breaks GL rendering. Emmanuele was going to investigate whats wrong in mesa to cause that.
Comment 4 Niels Nesse 2015-01-15 15:51:20 UTC
Immediately after adding back the version number attributes rendering broke for me too. See my full comment.

Rendering broke because the paint context is requesting a core context and there are legacy GL calls in the painting code. The call that causes it to break is glTexImage2D, it is no longer allowed to use a number in the range 1-4 as a parameter to the internal format field. With that call broken some of the textures don't get uploaded and you get a partially black screen. Again, the patch contains a fix for this.
Comment 5 James Legg 2015-01-18 19:13:15 UTC
*** Bug 743139 has been marked as a duplicate of this bug. ***
Comment 6 Emmanuele Bassi (:ebassi) 2015-01-28 11:59:35 UTC
*** Bug 743144 has been marked as a duplicate of this bug. ***
Comment 7 Emmanuele Bassi (:ebassi) 2015-01-28 12:00:15 UTC
the issue is that Mesa does not support GL contexts created with core profile to be shared with legacy profiles; this is what introduced the regression. I'm not entirely sure this is a bug in Mesa: the spec is not incredibly clear as to what happens if you try to use a legacy profile to draw on an offscreen framebuffer, and then use the core profile to draw the texture buffer on an onscreen framebuffer.

talking with Alex at the DX hackfest, we think that we should just drop legacy profiles support. this means porting our example code to modern GL.

in the meantime, this patch and the one in bug 743146 should be applied.
Comment 8 Fan, Chun-wei 2015-02-06 04:53:48 UTC
Hi,

I updated the Win32 GL backend [1] as well as Niels' patch also meant that we no longer need a ->upload_texture() for Windows, as the "4" in the default ->upload_texture() was the value that was not accepted by GL core contexts on Windows, which had to be replaced by GL_RGBA, for GLArea to work on Windows on my side (nVidia NVS4200m and GTx675mx, driver supports OpenGL 4.4 on my Windows 7/8.1 systems).

[1]: https://git.gnome.org/browse/gtk+/commit/?id=24e6bda26421053af5fc1c7c49e23437b560be1c

With blessings, thank you!