glsl: fixup external-oes shaders by mangling the required extension
authorMatthew Waters <matthew@centricular.com>
Wed, 15 Jun 2016 02:47:05 +0000 (12:47 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:20 +0000 (19:32 +0000)
commitdfd6565b4be5917f45ea7822a0dbffaac0cd127c
tree70144ac7d9c507ae922c027a4cdc4e3d3b772acf
parentf077d937adcccb742e27a03881c706c2e8a9269e
glsl: fixup external-oes shaders by mangling the required extension

Newer devices require using a different GLSL extension for accessing
external-oes textures in a shader using the texture() functions.

While the GL_OES_EGL_image_external_essl3 should supposedly be supported
on a any GLES3 android device, the extension was defined after a lot of the
older drivers were built so they will not know about it.  Thus there are two
possible interpretations of which of texture[2D]() should be supported for
external-oes textures.  Strict adherence to the GL_OES_EGL_image_external
extension spec which uses texture2D() or following GLES3's pattern, also
allowing texture() as a function for accessing external-oes textures

This adds another mangling pass to convert
 #extension GL_OES_EGL_image_external : ...
into
 #extension GL_OES_EGL_image_external_essl3 : ...
on GLES3 and when the GL_OES_EGL_image_external_essl3 extension is supported.

Only uses texture() when the GLES3 and the GL_OES_EGL_image_external_essl3
extension is supported for external-oes textures.
Uses GLES2 + texture2D() + GL_OES_EGL_image_external in all other external-oes
cases.

https://bugzilla.gnome.org/show_bug.cgi?id=766993
gst-libs/gst/gl/gstglcolorconvert.c
gst-libs/gst/gl/gstglsl.c
gst-libs/gst/gl/gstglsl_private.h
gst-libs/gst/gl/gstglviewconvert.c