mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
ac393aa657
In order to use oes-external, the qml6glsink needs a fragment shader that uses the samplerExternalOES. The qsb tool is not able to handle shaders that contain samplerExternalOES since this feature is not supported by all target shading languages. The qsb tool is able to replace a shader in the qsb file to handle this use case. Use it to generate a shader variant that uses samplerExternalOES for OpenGL ES and select that variant if the qml6glsink negotiated texture target oes-external. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7319>
31 lines
609 B
GLSL
31 lines
609 B
GLSL
#version 100
|
|
#extension GL_OES_EGL_image_external : require
|
|
precision highp float;
|
|
precision highp int;
|
|
|
|
struct buf
|
|
{
|
|
mat4 qt_Matrix;
|
|
ivec4 swizzle;
|
|
mat4 color_matrix;
|
|
float qt_Opacity;
|
|
};
|
|
|
|
uniform buf ubuf;
|
|
|
|
uniform samplerExternalOES tex;
|
|
|
|
varying vec2 vTexCoord;
|
|
|
|
vec4 swizzle(vec4 texel, ivec4 swizzle_1)
|
|
{
|
|
return vec4(texel[swizzle_1.x], texel[swizzle_1.y], texel[swizzle_1.z], texel[swizzle_1.w]);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
vec4 param = texture2D(tex, vTexCoord);
|
|
ivec4 param_1 = ubuf.swizzle;
|
|
vec4 texel = swizzle(param, param_1);
|
|
gl_FragData[0] = texel * ubuf.qt_Opacity;
|
|
}
|