summaryrefslogtreecommitdiffstats
path: root/src/qtmultimediaquicktools/shaders
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-03-25 17:18:18 +0100
committerLars Knoll <lars.knoll@qt.io>2021-04-07 12:25:03 +0000
commit0ce875a4e302afc5b67ec63d35051d90e486db79 (patch)
treed92029a2c9addfc96b7bc879adc7d0d8fe78930d /src/qtmultimediaquicktools/shaders
parent9e90ac3ce400df30217de98f0eb4e08f75e06cdf (diff)
Move the shaders from the quick tools into QtMultimedia
The shader layout is pretty generic, and QVideoSurfaceFormat can give us both the shaders and uniform data that we need to render the video. All the user needs to do then is to provide geometry with a 2D texture coordinate to render the video onto any surface. Change-Id: I95006eaf4a6f039006b8a5da0f53143da03e1ecb Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/shaders')
-rw-r--r--src/qtmultimediaquicktools/shaders/bgra.frag16
-rw-r--r--src/qtmultimediaquicktools/shaders/bgra.frag.qsbbin1265 -> 0 bytes
-rwxr-xr-xsrc/qtmultimediaquicktools/shaders/compile.bat52
-rw-r--r--src/qtmultimediaquicktools/shaders/nv12.frag25
-rw-r--r--src/qtmultimediaquicktools/shaders/nv12.frag.qsbbin1849 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/nv21.frag25
-rw-r--r--src/qtmultimediaquicktools/shaders/nv21.frag.qsbbin1848 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/p010be.frag25
-rw-r--r--src/qtmultimediaquicktools/shaders/p010be.frag.qsbbin1720 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/p010le.frag25
-rw-r--r--src/qtmultimediaquicktools/shaders/p010le.frag.qsbbin1736 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/rgba.frag16
-rw-r--r--src/qtmultimediaquicktools/shaders/rgba.frag.qsbbin1244 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/rgba.vert18
-rw-r--r--src/qtmultimediaquicktools/shaders/rgba.vert.qsbbin1511 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/uyvy.frag23
-rw-r--r--src/qtmultimediaquicktools/shaders/uyvy.frag.qsbbin1801 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/yuv.vert26
-rw-r--r--src/qtmultimediaquicktools/shaders/yuv.vert.qsbbin2017 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/yuv_yv.frag28
-rw-r--r--src/qtmultimediaquicktools/shaders/yuv_yv.frag.qsbbin1975 -> 0 bytes
-rw-r--r--src/qtmultimediaquicktools/shaders/yuyv.frag23
-rw-r--r--src/qtmultimediaquicktools/shaders/yuyv.frag.qsbbin1805 -> 0 bytes
23 files changed, 0 insertions, 302 deletions
diff --git a/src/qtmultimediaquicktools/shaders/bgra.frag b/src/qtmultimediaquicktools/shaders/bgra.frag
deleted file mode 100644
index f04e3e721..000000000
--- a/src/qtmultimediaquicktools/shaders/bgra.frag
+++ /dev/null
@@ -1,16 +0,0 @@
-#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/bgra.frag.qsb b/src/qtmultimediaquicktools/shaders/bgra.frag.qsb
deleted file mode 100644
index 4910d5654..000000000
--- a/src/qtmultimediaquicktools/shaders/bgra.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/compile.bat b/src/qtmultimediaquicktools/shaders/compile.bat
deleted file mode 100755
index f3524dd87..000000000
--- a/src/qtmultimediaquicktools/shaders/compile.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-::
-:: 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
-qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o p010le.frag.qsb p010le.frag
-qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o p010be.frag.qsb p010be.frag
diff --git a/src/qtmultimediaquicktools/shaders/nv12.frag b/src/qtmultimediaquicktools/shaders/nv12.frag
deleted file mode 100644
index 9ef6bd648..000000000
--- a/src/qtmultimediaquicktools/shaders/nv12.frag
+++ /dev/null
@@ -1,25 +0,0 @@
-#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/nv12.frag.qsb b/src/qtmultimediaquicktools/shaders/nv12.frag.qsb
deleted file mode 100644
index f5adaef48..000000000
--- a/src/qtmultimediaquicktools/shaders/nv12.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/nv21.frag b/src/qtmultimediaquicktools/shaders/nv21.frag
deleted file mode 100644
index 636294048..000000000
--- a/src/qtmultimediaquicktools/shaders/nv21.frag
+++ /dev/null
@@ -1,25 +0,0 @@
-#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/nv21.frag.qsb b/src/qtmultimediaquicktools/shaders/nv21.frag.qsb
deleted file mode 100644
index 6fb2c46dd..000000000
--- a/src/qtmultimediaquicktools/shaders/nv21.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/p010be.frag b/src/qtmultimediaquicktools/shaders/p010be.frag
deleted file mode 100644
index b098361ad..000000000
--- a/src/qtmultimediaquicktools/shaders/p010be.frag
+++ /dev/null
@@ -1,25 +0,0 @@
-#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).br;
- vec4 color = vec4(Y, UV.x, UV.y, 1.);
- fragColor = ubuf.colorMatrix * color * ubuf.opacity;
-}
diff --git a/src/qtmultimediaquicktools/shaders/p010be.frag.qsb b/src/qtmultimediaquicktools/shaders/p010be.frag.qsb
deleted file mode 100644
index c3f9c79d8..000000000
--- a/src/qtmultimediaquicktools/shaders/p010be.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/p010le.frag b/src/qtmultimediaquicktools/shaders/p010le.frag
deleted file mode 100644
index 514884b97..000000000
--- a/src/qtmultimediaquicktools/shaders/p010le.frag
+++ /dev/null
@@ -1,25 +0,0 @@
-#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).g;
- vec2 UV = texture(plane2Texture, plane2TexCoord).ga;
- vec4 color = vec4(Y, UV.x, UV.y, 1.);
- fragColor = ubuf.colorMatrix * color * ubuf.opacity;
-}
diff --git a/src/qtmultimediaquicktools/shaders/p010le.frag.qsb b/src/qtmultimediaquicktools/shaders/p010le.frag.qsb
deleted file mode 100644
index 8c047ee60..000000000
--- a/src/qtmultimediaquicktools/shaders/p010le.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/rgba.frag b/src/qtmultimediaquicktools/shaders/rgba.frag
deleted file mode 100644
index 1623c2cc7..000000000
--- a/src/qtmultimediaquicktools/shaders/rgba.frag
+++ /dev/null
@@ -1,16 +0,0 @@
-#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/rgba.frag.qsb b/src/qtmultimediaquicktools/shaders/rgba.frag.qsb
deleted file mode 100644
index 8f782fcdb..000000000
--- a/src/qtmultimediaquicktools/shaders/rgba.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/rgba.vert b/src/qtmultimediaquicktools/shaders/rgba.vert
deleted file mode 100644
index ebc53a65f..000000000
--- a/src/qtmultimediaquicktools/shaders/rgba.vert
+++ /dev/null
@@ -1,18 +0,0 @@
-#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/rgba.vert.qsb b/src/qtmultimediaquicktools/shaders/rgba.vert.qsb
deleted file mode 100644
index 3d81483ce..000000000
--- a/src/qtmultimediaquicktools/shaders/rgba.vert.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/uyvy.frag b/src/qtmultimediaquicktools/shaders/uyvy.frag
deleted file mode 100644
index f1c7c1aec..000000000
--- a/src/qtmultimediaquicktools/shaders/uyvy.frag
+++ /dev/null
@@ -1,23 +0,0 @@
-#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/uyvy.frag.qsb b/src/qtmultimediaquicktools/shaders/uyvy.frag.qsb
deleted file mode 100644
index bb3237004..000000000
--- a/src/qtmultimediaquicktools/shaders/uyvy.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/yuv.vert b/src/qtmultimediaquicktools/shaders/yuv.vert
deleted file mode 100644
index 6f103372f..000000000
--- a/src/qtmultimediaquicktools/shaders/yuv.vert
+++ /dev/null
@@ -1,26 +0,0 @@
-#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/yuv.vert.qsb b/src/qtmultimediaquicktools/shaders/yuv.vert.qsb
deleted file mode 100644
index d4605e8de..000000000
--- a/src/qtmultimediaquicktools/shaders/yuv.vert.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/yuv_yv.frag b/src/qtmultimediaquicktools/shaders/yuv_yv.frag
deleted file mode 100644
index 07ea52aab..000000000
--- a/src/qtmultimediaquicktools/shaders/yuv_yv.frag
+++ /dev/null
@@ -1,28 +0,0 @@
-#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/yuv_yv.frag.qsb b/src/qtmultimediaquicktools/shaders/yuv_yv.frag.qsb
deleted file mode 100644
index af1816011..000000000
--- a/src/qtmultimediaquicktools/shaders/yuv_yv.frag.qsb
+++ /dev/null
Binary files differ
diff --git a/src/qtmultimediaquicktools/shaders/yuyv.frag b/src/qtmultimediaquicktools/shaders/yuyv.frag
deleted file mode 100644
index 454fdc21e..000000000
--- a/src/qtmultimediaquicktools/shaders/yuyv.frag
+++ /dev/null
@@ -1,23 +0,0 @@
-#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/yuyv.frag.qsb b/src/qtmultimediaquicktools/shaders/yuyv.frag.qsb
deleted file mode 100644
index f7af4db3d..000000000
--- a/src/qtmultimediaquicktools/shaders/yuyv.frag.qsb
+++ /dev/null
Binary files differ