Commit graph

63 commits

Author SHA1 Message Date
Matthew Waters
25ec84fa63 gl: document missing GstGLShader functions 2017-07-28 16:58:38 +01:00
Sebastian Dröge
be08f0f9a8 gl: Fix indentation 2017-05-25 13:06:03 +03:00
Sebastian Dröge
634cd87c76 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-05-17 10:40:23 +03:00
Sebastian Dröge
65545ecfa3 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-05-15 12:07:13 +03:00
Thibault Saunier
78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Matthew Waters
41a6448918 gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2016-11-03 16:16:12 +11:00
Nirbheek Chauhan
7e6764e304 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.
2016-10-28 10:00:59 +05:30
Matthew Waters
d38587c142 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.
2016-03-31 20:52:42 +11:00
Matthew Waters
5061095e05 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.
2016-03-10 22:53:02 +11:00
Matthew Waters
23806d4953 gl: misc docs fixes/additions 2016-03-06 19:36:17 +11:00
Alessandro Decina
7c79b33108 gstglshader: cache uniform locations
Avoid redundant calls to glGetUniformLocation. The results can be cached once
the shader has been linked.
2016-02-10 16:37:22 +11:00
Matthew Waters
babd066b89 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
2015-11-13 17:00:46 +11:00
Matthew Waters
f24e768cc3 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.
2015-11-11 14:41:38 +11:00
Tim-Philipp Müller
edab4deb3a glshader, tsdemux: simplify code
Jus use _delete_link() instead of _remove_link() + _free1()
2015-11-06 13:00:55 +00:00
Matthew Waters
3dfc6899ad 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'
2015-10-19 15:15:30 +11:00
Matthew Waters
b25807c382 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.
2015-10-15 21:27:57 +11:00
Julien Isorce
f037b28a7b 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.
2015-07-02 15:16:56 +01:00
Matthew Waters
e1b077d6af 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.
2015-05-14 14:58:07 +10:00
Matthew Waters
3d0bc93edc glshader: remove references to gl3 specific shaders
We rely specifically on gles2 shaders being supported by the GL
implementation with GL3 core profile.
2015-05-14 14:58:07 +10:00
Matthew Waters
a29a18cc3a glshader: attribute locations are -1 on error 2015-03-13 17:41:17 +00:00
Neos3452
40a4530c5d 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
2015-03-13 17:35:18 +00:00
Edward Hervey
f09272f434 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
2015-02-12 15:57:55 +01:00
Matthew Waters
fca0bc97a4 glshader add support for gl3 2014-11-28 09:14:25 +11:00
Matthew Waters
d2cbc7cc16 glshader: advertise the default vertex and fragment shaders on desktop GL 2014-10-30 18:58:49 +11:00
Lubosz Sarnecki
d2cac06eeb glshader: expose opengl handle in getter
https://bugzilla.gnome.org/show_bug.cgi?id=734482
2014-08-21 17:38:36 +10:00
Matthew Waters
da35876537 glfeature: remove GST_GL_API_GLES3
instead check the gl version using gst_gl_context_check_gl_version()
2014-05-30 10:29:37 +10:00
Matthew Waters
c247be334a gl: make all GObjects inherit from GstObject
Aids memory leak debugging with GST_TRACE=mem-live
2014-05-08 15:33:43 +10:00
Julien Isorce
64e5b5a203 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.
2014-04-30 15:35:49 +01:00
Matthew Waters
870503dc6b gl: silence all the compiler warnings 2014-03-16 15:17:44 +01:00
Matthew Waters
9b22b0e0ba [812/906] move the GL vtable from GstGLDisplay to GstGLContext
Conflicts:
	tests/check/libs/gstglcontext.c
2014-03-15 18:37:02 +01:00
Sebastian Dröge
d87a0eaf1d [749/906] glshader: Add some more debug output 2014-03-15 18:36:58 +01:00
Julien Isorce
dd7e054e2c [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
2014-03-15 18:36:57 +01:00
Sebastian Dröge
98cca97840 [719/906] gl: Fix compilation with GLES2 2014-03-15 18:36:56 +01:00
Matthew Waters
11b810fcf5 [718/906] shader: make it possible to unref in the non-GL thread 2014-03-15 18:36:56 +01:00
Matthew Waters
09496fc8a1 [713/906] shader: make it possible to create the object in a non-GL thread 2014-03-15 18:36:56 +01:00
Matthew Waters
13067b104c [704/906] Use gst_object_[un]ref so we can get refcounts in the log 2014-03-15 18:36:56 +01:00
Matthew Waters
39e5b7c97f [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.
2014-03-15 18:36:54 +01:00
Matthew Waters
8b59321a7e [668/906] shader: fix gles2 segfault 2014-03-15 18:36:53 +01:00
Matthew Waters
7b03a572d9 [647/906] remove dependecy on glew 2014-03-15 18:36:52 +01:00
Matthew Waters
fa3c3b8434 [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
2014-03-15 18:36:52 +01:00
Matthew Waters
86844030d6 [627/906] shader: check for invalid objects 2014-03-15 18:36:51 +01:00
Matthew Waters
cc8e54541b [624/906] OPENGL_ES2 => HAVE_GLES2 and add HAVE_OPENGL
use GstGLAPI to determine which code paths to execute.
perform some cleanups
2014-03-15 18:36:51 +01:00
Matthew Waters
13ec239924 [605/906] shader: move to gst debugging 2014-03-15 18:36:50 +01:00
Matthew Waters
93f7e993ad [603/906] update FSF address 2014-03-15 18:36:50 +01:00
Julien Isorce
a1649a497a [495/906] glES2.0: properly use glDeleteShader 2014-03-15 18:36:43 +01:00
Julien Isorce
052c23c3c5 [491/906] glES2.0: properly fails if driver/kernel inconsistency 2014-03-15 18:36:43 +01:00
Julien Isorce
2394987226 [490/906] gldisplay: error out instead of g_assert 2014-03-15 18:36:43 +01:00
Julien Isorce
591b4282ed [477/906] OpenGL ES 2.0: fix build since glfiltershader changes 2014-03-15 18:36:42 +01:00
Luc Deschenaux
268f1a30b2 [471/906] glshader: add dynamic fragment shader filter
Also add fragment shader parser
Fix bug #600195
2014-03-15 18:36:42 +01:00
Julien Isorce
d21aaa22bf [467/906] tests: various build fixes
- cmake could not find glib
 - put gtk variables at the beginning to avoid GL conflicts
 - update examples to clutter-1.8
 - use const instead of deprecated G_CONST_RETURN
 - set max pending events to 0 to make cube example works again
2014-03-15 18:36:42 +01:00