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 740012 - gl: support opengl3+ core contexts
gl: support opengl3+ core contexts
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal blocker
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-12 13:58 UTC by Matthew Waters (ystreet00)
Modified: 2014-11-29 13:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gldisplay: return GST_GL_API_NONE if display is not a GL_DISPLAY (873 bytes, patch)
2014-11-27 23:00 UTC, Aurélien Zanelli
rejected Details | Review

Description Matthew Waters (ystreet00) 2014-11-12 13:58:23 UTC
Some preliminary code is available from:

https://github.com/ystreet/gst-plugins-bad/gl3

Only glx asks for the gl3 core context.

Currently it unconditionally relies on the GL_ARB_es2_compatability extension to use the gles2 shaders without modification because I'm lazy :).  That will need to be rectified by generating gl3 shaders either automatically (hard) or manually (easy ;)).

The following elements have been ported:
glimagesink, glcolorscale, gleffects (gles2 part).
Comment 1 Sebastian Dröge (slomo) 2014-11-12 14:32:05 UTC
On OSX this can also be easily activated by passing additional attributes to the context creation. I experimented a bit with that some time ago but don't have the changes anymore :)
Comment 2 Julien Isorce 2014-11-13 07:53:58 UTC
Great!

The correct link seems to be https://github.com/ystreet/gst-plugins-bad/commits/gl3

This is another subject but looking at the commits I think we should create gstgl API for vao's and vbo's . I can see that gstglcolorconvert, gstglfilter and gstglimagesink code around this.

Also out of curiosity, in theory it should be faster but do you actually see any measurable performance gain ?
Comment 3 Matthew Waters (ystreet00) 2014-11-13 14:00:54 UTC
(In reply to comment #2)
> This is another subject but looking at the commits I think we should create
> gstgl API for vao's and vbo's . I can see that gstglcolorconvert, gstglfilter
> and gstglimagesink code around this.

For vbo's and gl buffers in general, I was thinking of some GstMemory subclass so that it might be possible to pass vertex data through elements (It also future proofs the 3d modelling side of things where that's pretty much all you deal with).  also related is bug #726412

I'm still undecided on what to do with vao's for the exact same reason as framebuffers.  They are simply client-side container objects that are not shareable across contexts and I'm not sure where they fit in with the gstgl API yet.

> Also out of curiosity, in theory it should be faster but do you actually see
> any measurable performance gain ?

No, we're not push anywhere near enough vertex data to have any performance impact :)
Comment 4 Matthew Waters (ystreet00) 2014-11-27 22:27:39 UTC
I've just merged this branch irrespective of the shader versions issue as it seems that GL_ARB_ES2_compatability is supported by all the major drivers.

http://feedback.wildfiregames.com/report/opengl/feature/GL_ARB_ES2_compatibility
Comment 5 Aurélien Zanelli 2014-11-27 23:00:46 UTC
Created attachment 291688 [details] [review]
gldisplay: return GST_GL_API_NONE if display is not a GL_DISPLAY

These commits break compilation with fatal warnings due to return with no value on a non-void function.

This commit fix it by returning GST_GL_API_NONE.
Comment 6 Matthew Waters (ystreet00) 2014-11-27 23:09:58 UTC
Thanks for the patch however I already fixed it and did not see you patch :)

commit f67190d3ca6f5d947a1f21ee5d52dcb5082655be
Author: Matthew Waters <matthew@centricular.com>
Date:   Fri Nov 28 10:03:18 2014 +1100

    gldisplay: fix build error
    
    gstgldisplay.c:234:541: error: 'return' with no value, in function returning non-void [-Werror]
       g_return_if_fail (GST_IS_GL_DISPLAY (display));
Comment 7 Sebastian Dröge (slomo) 2014-11-28 10:03:58 UTC
We should probably add some code that checks if the extension is actually available and fails early otherwise.
Comment 8 Sebastian Dröge (slomo) 2014-11-28 15:49:04 UTC
This breaks on platforms that don't support GL3, or hide GL3 functions if creating a context for an older version. E.g. OSX.

glimagesink now unconditionally uses glGenVertexArrays (and a lot of other code too), which is only available in GL3 and GLES2.
Comment 9 Matthew Waters (ystreet00) 2014-11-29 13:45:35 UTC
commit 90a2477b9e63136730bf01d1ebcaec1a42dd3962
Author: Matthew Waters <matthew@centricular.com>
Date:   Sun Nov 30 00:42:17 2014 +1100

    glcontext: require GL_ARB_ES2_compatibility for opengl3
    
    until we generate gl3 compliant shaders
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740012

commit 6361df77e8eac857e3757b13810be64ae347f786
Author: Matthew Waters <matthew@centricular.com>
Date:   Sun Nov 30 00:18:55 2014 +1100

    glimagesink: properly handle the !opengl3 case
    
    https://bugzilla.gnome.org/show_bug.cgi?id=740012