Commit graph

69 commits

Author SHA1 Message Date
Matthew Waters
51f2d05ff6 gl/docs: add to new docs system 2019-05-21 01:49:48 +00:00
Víctor Manuel Jáquez Leal
9be278d4f5 gl: libs: glib might not define G_HAVE_ISO_VARARGS
This will fix the compiler warning
"G_HAVE_ISO_VARARGS" is not defined, evaluates to 0 [-Wundef]
2018-11-23 11:20:36 +00:00
Matthew Waters
333566c53e glshader: macro out all the extremely similar uniform setting 2018-09-18 11:13:27 +10:00
Tim-Philipp Müller
d736bfc855 gl: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 22:58:44 +02:00
Matthew Waters
90198daed1 gl: some annotation fixes 2018-02-05 14:58:06 +11:00
Matthew Waters
a534d8d74c gl/shader: allow setting non-square matrices as uniforms on gles platforms
It is possible with GLES3
2017-12-09 19:32:30 +00:00
Matthew Waters
5c4b47e615 gl: document missing GstGLShader functions 2017-12-09 19:32:29 +00:00
Sebastian Dröge
0572c41c28 gl: Fix indentation 2017-12-09 19:32:28 +00:00
Sebastian Dröge
a9a05c01a9 gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-12-09 19:32:28 +00:00
Sebastian Dröge
6b1fa09077 glshader: Make reference counting of attach() consistent
https://bugzilla.gnome.org/show_bug.cgi?id=747990
https://bugzilla.gnome.org/show_bug.cgi?id=702960
2017-12-09 19:32:27 +00:00
Thibault Saunier
95ac4d5175 docs: Port all docstring to gtk-doc markdown 2017-12-09 19:32:27 +00:00
Matthew Waters
18ac98c58b gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
d57808385c gstgl: Re-enable WINAPI on _MSC_VER
The calling convention may be deprecated, but we still need it for
OpenGL. The build issue was caused by an incorrect syntax being used for
the WINAPI (__stdcall) prototype in function pointers which was accepted
by GCC but is rejected by MSVC.
2017-12-09 19:32:23 +00:00
Matthew Waters
ccbf43987f glshader: add glBindFragDataLocation
There are some cases where it's needed for binding in/out variables in shaders.
e.g. glsl 150 (gl 3.2) doesn't support the 'layout (location = ?)' specifiers in
the shader source so we have to bind them ourselves.
2017-12-09 19:32:18 +00:00
Matthew Waters
fdca1dec0d glshader: some compatibility changes for GL 1.4
GL 1.4 (with GL_ARB_shader_objects) doesn't have glIsProgram or glIsShader
equivalents.  As they are simply assertions, skip them when there isn't a
valid function pointer.
2017-12-09 19:32:17 +00:00
Matthew Waters
31b1094744 gl: misc docs fixes/additions 2017-12-09 19:32:17 +00:00
Alessandro Decina
bc8d272aad gstglshader: cache uniform locations
Avoid redundant calls to glGetUniformLocation. The results can be cached once
the shader has been linked.
2017-12-09 19:32:16 +00:00
Matthew Waters
148940c456 glshader: don't read invalid list pointers (use after free)
gst_gl_shader_detach_unlocked already removes the list entry so attempting to
use the element to iterate to the next stage could read invalid data.

Based on patch by Vineeth TM <vineeth.tm@samsung.com>

https://bugzilla.gnome.org/show_bug.cgi?id=758039
2017-12-09 19:32:11 +00:00
Matthew Waters
117fc0409a glshader: properly unref the stages on failure
When failing in the varargs functions, all the stage objects not handled need to
be unreffed to prevent a leak.
2017-12-09 19:32:11 +00:00
Tim-Philipp Müller
7a166e019b glshader, tsdemux: simplify code
Jus use _delete_link() instead of _remove_link() + _free1()
2017-12-09 19:32:10 +00:00
Matthew Waters
06de6998e5 gl: be consistent in gobject boilerpate
GST_GL_IS_* vs GST_IS_GL_*

git grep -l 'GST_GL_IS_' | xargs sed -i 's/GST_GL_IS_/GST_IS_GL_/g'
2017-12-09 19:32:09 +00:00
Matthew Waters
f688a8f0b2 glshader: port to using GstGLSLStage objects for string management
A GstGLShader is now simply a collection of stages that are
compiled and linked together into a program.  The uniform/attribute
interface has remained the same.
2017-12-09 19:32:09 +00:00
Julien Isorce
9b1eb32c49 gl: initialize output params to 0 before calling gl functions
The client side API of the Chromium's GPU Process has asserts
in debug mode that check that output params are initialized to 0.
2017-12-09 19:32:05 +00:00
Matthew Waters
675f789871 glshader: attempt to detect the gles2 inside opengl3 case
This is necessary to use gles2 shaders in a GL 3 core context on
OS X which fails without a proper #version being set on the shaders.
2017-12-09 19:32:01 +00:00
Matthew Waters
2b4ce9435d glshader: remove references to gl3 specific shaders
We rely specifically on gles2 shaders being supported by the GL
implementation with GL3 core profile.
2017-12-09 19:32:01 +00:00
Matthew Waters
15fd4e164a glshader: attribute locations are -1 on error 2017-12-09 19:31:57 +00:00
Neos3452
7d83351172 glshader: prevent from getting attributes without vertex shader
It doesn't make sense to query for vertex attributes without a vertex
shader. Moreover this is causing a crash on OSX.

https://bugzilla.gnome.org/show_bug.cgi?id=746168
2017-12-09 19:31:57 +00:00
Edward Hervey
f56c4c541a gl: Add/Update more debug statements
Where possible, use the _OBJECT variants in order to track better from
which object the debug statement is coming from

Define (and use) GST_CAT_DEFAULT where applicable

Use GST_PTR_FORMAT where applicable
2017-12-09 19:31:54 +00:00
Matthew Waters
dcd5fce8fb glshader add support for gl3 2017-12-09 19:31:50 +00:00
Matthew Waters
366eaea6d2 glshader: advertise the default vertex and fragment shaders on desktop GL 2017-12-09 19:31:49 +00:00
Lubosz Sarnecki
67b9f71619 glshader: expose opengl handle in getter
https://bugzilla.gnome.org/show_bug.cgi?id=734482
2017-12-09 19:31:45 +00:00
Matthew Waters
4a8b31afd6 glfeature: remove GST_GL_API_GLES3
instead check the gl version using gst_gl_context_check_gl_version()
2017-12-09 19:31:42 +00:00
Matthew Waters
857200ff40 gl: make all GObjects inherit from GstObject
Aids memory leak debugging with GST_TRACE=mem-live
2017-12-09 19:31:39 +00:00
Julien Isorce
cebcc837de gl: add convenient functions to setup default vertex and fragment shaders
Most of our 2D filters use the same simple vertex shader.
Also define the default fragment shader as the identity.

Avoid duplicating the same vertex and fragment shader text.
2017-12-09 19:31:38 +00:00
Matthew Waters
e225af3e0d gl: silence all the compiler warnings 2017-12-09 19:31:34 +00:00
Matthew Waters
711ad485b2 [812/906] move the GL vtable from GstGLDisplay to GstGLContext
Conflicts:
	tests/check/libs/gstglcontext.c
2017-12-09 19:31:31 +00:00
Sebastian Dröge
9d4f99b8bb [749/906] glshader: Add some more debug output 2017-12-09 19:31:29 +00:00
Julien Isorce
d17a4381b1 [732/906] build: fix repeated typedefs
Write forward declarations in another way to avoid
repeated typedefs "error: redefinition of typedef".
Raised when using i686-apple-darwin11-llvm-gcc-4.2
It seems that C apple compiler does not support
C11 feature.

https://bugzilla.gnome.org/show_bug.cgi?id=703885
2017-12-09 19:31:29 +00:00
Sebastian Dröge
685d855ded [719/906] gl: Fix compilation with GLES2 2017-12-09 19:31:28 +00:00
Matthew Waters
5b13d0ebf4 [718/906] shader: make it possible to unref in the non-GL thread 2017-12-09 19:31:28 +00:00
Matthew Waters
d7f5cac7ce [713/906] shader: make it possible to create the object in a non-GL thread 2017-12-09 19:31:28 +00:00
Matthew Waters
761bc0156a [704/906] Use gst_object_[un]ref so we can get refcounts in the log 2017-12-09 19:31:28 +00:00
Matthew Waters
1a04002052 [681/906] win32: fix gl api calls on 32-bit
win has the bright idea of having 5 different calling conventions.
we should probably use the right one so we don't crash from stack
corruption.
2017-12-09 19:31:27 +00:00
Matthew Waters
63a5d9e981 [668/906] shader: fix gles2 segfault 2017-12-09 19:31:27 +00:00
Matthew Waters
6bee9b9c93 [647/906] remove dependecy on glew 2017-12-09 19:31:27 +00:00
Matthew Waters
e983f02e87 [642/906] add gstglconfig.h for apps to find out what our capabilites are
ie libgstgl can be compiled with any combination of opengl/gles2
2017-12-09 19:31:26 +00:00
Matthew Waters
6c0e32864a [627/906] shader: check for invalid objects 2017-12-09 19:31:26 +00:00
Matthew Waters
344253e860 [624/906] OPENGL_ES2 => HAVE_GLES2 and add HAVE_OPENGL
use GstGLAPI to determine which code paths to execute.
perform some cleanups
2017-12-09 19:31:26 +00:00
Matthew Waters
9dd6570ca9 [605/906] shader: move to gst debugging 2017-12-09 19:31:25 +00:00
Matthew Waters
4c35d682c9 [603/906] update FSF address 2017-12-09 19:31:25 +00:00