GNOME Bugzilla – Bug 742953
GdkGLContext will not create a core context
Last modified: 2015-02-06 04:53:48 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.
Created attachment 294570 [details] [review] Proposed fix for bug
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.
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.
*** Bug 743139 has been marked as a duplicate of this bug. ***
*** Bug 743144 has been marked as a duplicate of this bug. ***
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.
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!