diff options
Diffstat (limited to 'src/qtmultimediaquicktools/shaders_ng')
19 files changed, 250 insertions, 0 deletions
diff --git a/src/qtmultimediaquicktools/shaders_ng/bgra.frag b/src/qtmultimediaquicktools/shaders_ng/bgra.frag new file mode 100644 index 000000000..f04e3e721 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/bgra.frag @@ -0,0 +1,16 @@ +#version 440 + +layout(location = 0) in vec2 qt_TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + float opacity; +} ubuf; + +layout(binding = 1) uniform sampler2D rgbTexture; + +void main() +{ + fragColor = texture(rgbTexture, qt_TexCoord).bgra * ubuf.opacity; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/bgra.frag.qsb b/src/qtmultimediaquicktools/shaders_ng/bgra.frag.qsb Binary files differnew file mode 100644 index 000000000..20c61e92f --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/bgra.frag.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/compile.bat b/src/qtmultimediaquicktools/shaders_ng/compile.bat new file mode 100755 index 000000000..682cc71b8 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/compile.bat @@ -0,0 +1,50 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2019 The Qt Company Ltd. +:: Contact: https://www.qt.io/licensing/ +:: +:: This file is part of the QtQuick module of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:LGPL$ +:: Commercial License Usage +:: Licensees holding valid commercial Qt licenses may use this file in +:: accordance with the commercial license agreement provided with the +:: Software or, alternatively, in accordance with the terms contained in +:: a written agreement between you and The Qt Company. For licensing terms +:: and conditions see https://www.qt.io/terms-conditions. For further +:: information use the contact form at https://www.qt.io/contact-us. +:: +:: GNU Lesser General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU Lesser +:: General Public License version 3 as published by the Free Software +:: Foundation and appearing in the file LICENSE.LGPL3 included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU Lesser General Public License version 3 requirements +:: will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +:: +:: GNU General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU +:: General Public License version 2.0 or (at your option) the GNU General +:: Public license version 3 or any later version approved by the KDE Free +:: Qt Foundation. The licenses are as published by the Free Software +:: Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +:: included in the packaging of this file. Please review the following +:: information to ensure the GNU General Public License requirements will +:: be met: https://www.gnu.org/licenses/gpl-2.0.html and +:: https://www.gnu.org/licenses/gpl-3.0.html. +:: +:: $QT_END_LICENSE$ +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o rgba.vert.qsb rgba.vert +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o rgba.frag.qsb rgba.frag +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o bgra.frag.qsb bgra.frag + +qsb -b --glsl "150,120,100 es" --hlsl 50 --msl 12 -o yuv.vert.qsb yuv.vert +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o yuv_yv.frag.qsb yuv_yv.frag + +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o nv12.frag.qsb nv12.frag +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o nv21.frag.qsb nv21.frag +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o uyvy.frag.qsb uyvy.frag +qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o yuyv.frag.qsb yuyv.frag diff --git a/src/qtmultimediaquicktools/shaders_ng/nv12.frag b/src/qtmultimediaquicktools/shaders_ng/nv12.frag new file mode 100644 index 000000000..9ef6bd648 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/nv12.frag @@ -0,0 +1,25 @@ +#version 440 + +layout(location = 0) in vec2 plane1TexCoord; +layout(location = 1) in vec2 plane2TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + mat4 colorMatrix; + float opacity; + float plane1Width; + float plane2Width; + float plane3Width; +} ubuf; + +layout(binding = 1) uniform sampler2D plane1Texture; +layout(binding = 2) uniform sampler2D plane2Texture; + +void main() +{ + float Y = texture(plane1Texture, plane1TexCoord).r; + vec2 UV = texture(plane2Texture, plane2TexCoord).rg; + vec4 color = vec4(Y, UV.x, UV.y, 1.); + fragColor = ubuf.colorMatrix * color * ubuf.opacity; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/nv12.frag.qsb b/src/qtmultimediaquicktools/shaders_ng/nv12.frag.qsb Binary files differnew file mode 100644 index 000000000..f3402d460 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/nv12.frag.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/nv21.frag b/src/qtmultimediaquicktools/shaders_ng/nv21.frag new file mode 100644 index 000000000..636294048 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/nv21.frag @@ -0,0 +1,25 @@ +#version 440 + +layout(location = 0) in vec2 plane1TexCoord; +layout(location = 1) in vec2 plane2TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + mat4 colorMatrix; + float opacity; + float plane1Width; + float plane2Width; + float plane3Width; +} ubuf; + +layout(binding = 1) uniform sampler2D plane1Texture; +layout(binding = 2) uniform sampler2D plane2Texture; + +void main() +{ + float Y = texture(plane1Texture, plane1TexCoord).r; + vec2 UV = texture(plane2Texture, plane2TexCoord).gr; + vec4 color = vec4(Y, UV.x, UV.y, 1.); + fragColor = ubuf.colorMatrix * color * ubuf.opacity; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/nv21.frag.qsb b/src/qtmultimediaquicktools/shaders_ng/nv21.frag.qsb Binary files differnew file mode 100644 index 000000000..b90af8c53 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/nv21.frag.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/rgba.frag b/src/qtmultimediaquicktools/shaders_ng/rgba.frag new file mode 100644 index 000000000..1623c2cc7 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/rgba.frag @@ -0,0 +1,16 @@ +#version 440 + +layout(location = 0) in vec2 qt_TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + float opacity; +} ubuf; + +layout(binding = 1) uniform sampler2D rgbTexture; + +void main() +{ + fragColor = texture(rgbTexture, qt_TexCoord) * ubuf.opacity; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/rgba.frag.qsb b/src/qtmultimediaquicktools/shaders_ng/rgba.frag.qsb Binary files differnew file mode 100644 index 000000000..c1ecaa7bf --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/rgba.frag.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/rgba.vert b/src/qtmultimediaquicktools/shaders_ng/rgba.vert new file mode 100644 index 000000000..ebc53a65f --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/rgba.vert @@ -0,0 +1,18 @@ +#version 440 + +layout(location = 0) in vec4 qt_VertexPosition; +layout(location = 1) in vec2 qt_VertexTexCoord; + +layout(location = 0) out vec2 qt_TexCoord; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + float opacity; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() { + qt_TexCoord = qt_VertexTexCoord; + gl_Position = ubuf.matrix * qt_VertexPosition; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/rgba.vert.qsb b/src/qtmultimediaquicktools/shaders_ng/rgba.vert.qsb Binary files differnew file mode 100644 index 000000000..f655df0db --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/rgba.vert.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/uyvy.frag b/src/qtmultimediaquicktools/shaders_ng/uyvy.frag new file mode 100644 index 000000000..f1c7c1aec --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/uyvy.frag @@ -0,0 +1,23 @@ +#version 440 + +layout(location = 0) in vec2 plane1TexCoord; +layout(location = 1) in vec2 plane2TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + mat4 colorMatrix; + float opacity; + float plane1Width; + float plane2Width; + float plane3Width; +} ubuf; + +layout(binding = 1) uniform sampler2D plane1Texture; +layout(binding = 2) uniform sampler2D plane2Texture; + +void main() +{ + vec3 YUV = vec3(texture(plane1Texture, plane1TexCoord).g, texture(plane2Texture, plane2TexCoord).rb); + fragColor = ubuf.colorMatrix * vec4(YUV, 1.0) * ubuf.opacity; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/uyvy.frag.qsb b/src/qtmultimediaquicktools/shaders_ng/uyvy.frag.qsb Binary files differnew file mode 100644 index 000000000..902821fd3 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/uyvy.frag.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/yuv.vert b/src/qtmultimediaquicktools/shaders_ng/yuv.vert new file mode 100644 index 000000000..6f103372f --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/yuv.vert @@ -0,0 +1,26 @@ +#version 440 + +layout(location = 0) in vec4 qt_VertexPosition; +layout(location = 1) in vec2 qt_VertexTexCoord; + +layout(location = 0) out vec2 plane1TexCoord; +layout(location = 1) out vec2 plane2TexCoord; +layout(location = 2) out vec2 plane3TexCoord; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + mat4 colorMatrix; + float opacity; + float plane1Width; + float plane2Width; + float plane3Width; +} ubuf; + +out gl_PerVertex { vec4 gl_Position; }; + +void main() { + plane1TexCoord = qt_VertexTexCoord * vec2(ubuf.plane1Width, 1); + plane2TexCoord = qt_VertexTexCoord * vec2(ubuf.plane2Width, 1); + plane3TexCoord = qt_VertexTexCoord * vec2(ubuf.plane3Width, 1); + gl_Position = ubuf.matrix * qt_VertexPosition; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/yuv.vert.qsb b/src/qtmultimediaquicktools/shaders_ng/yuv.vert.qsb Binary files differnew file mode 100644 index 000000000..0cde24cf6 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/yuv.vert.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/yuv_yv.frag b/src/qtmultimediaquicktools/shaders_ng/yuv_yv.frag new file mode 100644 index 000000000..07ea52aab --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/yuv_yv.frag @@ -0,0 +1,28 @@ +#version 440 + +layout(location = 0) in vec2 plane1TexCoord; +layout(location = 1) in vec2 plane2TexCoord; +layout(location = 2) in vec2 plane3TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + mat4 colorMatrix; + float opacity; + float plane1Width; + float plane2Width; + float plane3Width; +} ubuf; + +layout(binding = 1) uniform sampler2D plane1Texture; +layout(binding = 2) uniform sampler2D plane2Texture; +layout(binding = 3) uniform sampler2D plane3Texture; + +void main() +{ + float Y = texture(plane1Texture, plane1TexCoord).r; + float U = texture(plane2Texture, plane2TexCoord).r; + float V = texture(plane3Texture, plane3TexCoord).r; + vec4 color = vec4(Y, U, V, 1.); + fragColor = ubuf.colorMatrix * color * ubuf.opacity; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/yuv_yv.frag.qsb b/src/qtmultimediaquicktools/shaders_ng/yuv_yv.frag.qsb Binary files differnew file mode 100644 index 000000000..b6e3fe366 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/yuv_yv.frag.qsb diff --git a/src/qtmultimediaquicktools/shaders_ng/yuyv.frag b/src/qtmultimediaquicktools/shaders_ng/yuyv.frag new file mode 100644 index 000000000..454fdc21e --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/yuyv.frag @@ -0,0 +1,23 @@ +#version 440 + +layout(location = 0) in vec2 plane1TexCoord; +layout(location = 1) in vec2 plane2TexCoord; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 matrix; + mat4 colorMatrix; + float opacity; + float plane1Width; + float plane2Width; + float plane3Width; +} ubuf; + +layout(binding = 1) uniform sampler2D plane1Texture; +layout(binding = 2) uniform sampler2D plane2Texture; + +void main() +{ + vec3 YUV = vec3(texture(plane1Texture, plane1TexCoord).r, texture(plane2Texture, plane2TexCoord).ga); + fragColor = ubuf.colorMatrix * vec4(YUV, 1.0) * ubuf.opacity; +} diff --git a/src/qtmultimediaquicktools/shaders_ng/yuyv.frag.qsb b/src/qtmultimediaquicktools/shaders_ng/yuyv.frag.qsb Binary files differnew file mode 100644 index 000000000..543361af6 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders_ng/yuyv.frag.qsb |