summaryrefslogtreecommitdiffstats
path: root/src/multimedia/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/multimedia/shaders')
-rw-r--r--src/multimedia/shaders/ayuv.frag9
-rw-r--r--src/multimedia/shaders/nv12.frag10
-rw-r--r--src/multimedia/shaders/nv21.frag10
-rw-r--r--src/multimedia/shaders/p010.frag10
-rw-r--r--src/multimedia/shaders/uyvy.frag8
-rw-r--r--src/multimedia/shaders/yuv.vert11
-rw-r--r--src/multimedia/shaders/yuv_yv.frag13
-rw-r--r--src/multimedia/shaders/yuyv.frag8
8 files changed, 21 insertions, 58 deletions
diff --git a/src/multimedia/shaders/ayuv.frag b/src/multimedia/shaders/ayuv.frag
index 100c6512c..6ae19b166 100644
--- a/src/multimedia/shaders/ayuv.frag
+++ b/src/multimedia/shaders/ayuv.frag
@@ -1,23 +1,18 @@
#version 440
-layout(location = 0) in vec2 plane1TexCoord;
-layout(location = 1) in vec2 plane2TexCoord;
+layout(location = 0) in vec2 texCoord;
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 = texture(plane1Texture, plane1TexCoord).gra;
+ vec3 YUV = texture(plane1Texture, texCoord).gra;
fragColor = ubuf.colorMatrix * vec4(YUV, 1.0) * ubuf.opacity;
}
diff --git a/src/multimedia/shaders/nv12.frag b/src/multimedia/shaders/nv12.frag
index 9ef6bd648..49c333c98 100644
--- a/src/multimedia/shaders/nv12.frag
+++ b/src/multimedia/shaders/nv12.frag
@@ -1,16 +1,12 @@
#version 440
-layout(location = 0) in vec2 plane1TexCoord;
-layout(location = 1) in vec2 plane2TexCoord;
+layout(location = 0) in vec2 texCoord;
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;
@@ -18,8 +14,8 @@ layout(binding = 2) uniform sampler2D plane2Texture;
void main()
{
- float Y = texture(plane1Texture, plane1TexCoord).r;
- vec2 UV = texture(plane2Texture, plane2TexCoord).rg;
+ float Y = texture(plane1Texture, texCoord).r;
+ vec2 UV = texture(plane2Texture, texCoord).rg;
vec4 color = vec4(Y, UV.x, UV.y, 1.);
fragColor = ubuf.colorMatrix * color * ubuf.opacity;
}
diff --git a/src/multimedia/shaders/nv21.frag b/src/multimedia/shaders/nv21.frag
index 636294048..5876c504a 100644
--- a/src/multimedia/shaders/nv21.frag
+++ b/src/multimedia/shaders/nv21.frag
@@ -1,16 +1,12 @@
#version 440
-layout(location = 0) in vec2 plane1TexCoord;
-layout(location = 1) in vec2 plane2TexCoord;
+layout(location = 0) in vec2 texCoord;
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;
@@ -18,8 +14,8 @@ layout(binding = 2) uniform sampler2D plane2Texture;
void main()
{
- float Y = texture(plane1Texture, plane1TexCoord).r;
- vec2 UV = texture(plane2Texture, plane2TexCoord).gr;
+ float Y = texture(plane1Texture, texCoord).r;
+ vec2 UV = texture(plane2Texture, texCoord).gr;
vec4 color = vec4(Y, UV.x, UV.y, 1.);
fragColor = ubuf.colorMatrix * color * ubuf.opacity;
}
diff --git a/src/multimedia/shaders/p010.frag b/src/multimedia/shaders/p010.frag
index 9ef6bd648..49c333c98 100644
--- a/src/multimedia/shaders/p010.frag
+++ b/src/multimedia/shaders/p010.frag
@@ -1,16 +1,12 @@
#version 440
-layout(location = 0) in vec2 plane1TexCoord;
-layout(location = 1) in vec2 plane2TexCoord;
+layout(location = 0) in vec2 texCoord;
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;
@@ -18,8 +14,8 @@ layout(binding = 2) uniform sampler2D plane2Texture;
void main()
{
- float Y = texture(plane1Texture, plane1TexCoord).r;
- vec2 UV = texture(plane2Texture, plane2TexCoord).rg;
+ float Y = texture(plane1Texture, texCoord).r;
+ vec2 UV = texture(plane2Texture, texCoord).rg;
vec4 color = vec4(Y, UV.x, UV.y, 1.);
fragColor = ubuf.colorMatrix * color * ubuf.opacity;
}
diff --git a/src/multimedia/shaders/uyvy.frag b/src/multimedia/shaders/uyvy.frag
index f1c7c1aec..d48e9a5b5 100644
--- a/src/multimedia/shaders/uyvy.frag
+++ b/src/multimedia/shaders/uyvy.frag
@@ -1,16 +1,12 @@
#version 440
-layout(location = 0) in vec2 plane1TexCoord;
-layout(location = 1) in vec2 plane2TexCoord;
+layout(location = 0) in vec2 texCoord;
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;
@@ -18,6 +14,6 @@ layout(binding = 2) uniform sampler2D plane2Texture;
void main()
{
- vec3 YUV = vec3(texture(plane1Texture, plane1TexCoord).g, texture(plane2Texture, plane2TexCoord).rb);
+ vec3 YUV = vec3(texture(plane1Texture, texCoord).g, texture(plane2Texture, texCoord).rb);
fragColor = ubuf.colorMatrix * vec4(YUV, 1.0) * ubuf.opacity;
}
diff --git a/src/multimedia/shaders/yuv.vert b/src/multimedia/shaders/yuv.vert
index 6f103372f..cc73b37bf 100644
--- a/src/multimedia/shaders/yuv.vert
+++ b/src/multimedia/shaders/yuv.vert
@@ -3,24 +3,17 @@
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(location = 0) out vec2 texCoord;
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);
+ texCoord = qt_VertexTexCoord;
gl_Position = ubuf.matrix * qt_VertexPosition;
}
diff --git a/src/multimedia/shaders/yuv_yv.frag b/src/multimedia/shaders/yuv_yv.frag
index 07ea52aab..26fa202f5 100644
--- a/src/multimedia/shaders/yuv_yv.frag
+++ b/src/multimedia/shaders/yuv_yv.frag
@@ -1,17 +1,12 @@
#version 440
-layout(location = 0) in vec2 plane1TexCoord;
-layout(location = 1) in vec2 plane2TexCoord;
-layout(location = 2) in vec2 plane3TexCoord;
+layout(location = 0) in vec2 texCoord;
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;
@@ -20,9 +15,9 @@ 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;
+ float Y = texture(plane1Texture, texCoord).r;
+ float U = texture(plane2Texture, texCoord).r;
+ float V = texture(plane3Texture, texCoord).r;
vec4 color = vec4(Y, U, V, 1.);
fragColor = ubuf.colorMatrix * color * ubuf.opacity;
}
diff --git a/src/multimedia/shaders/yuyv.frag b/src/multimedia/shaders/yuyv.frag
index 454fdc21e..6838596e8 100644
--- a/src/multimedia/shaders/yuyv.frag
+++ b/src/multimedia/shaders/yuyv.frag
@@ -1,16 +1,12 @@
#version 440
-layout(location = 0) in vec2 plane1TexCoord;
-layout(location = 1) in vec2 plane2TexCoord;
+layout(location = 0) in vec2 texCoord;
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;
@@ -18,6 +14,6 @@ layout(binding = 2) uniform sampler2D plane2Texture;
void main()
{
- vec3 YUV = vec3(texture(plane1Texture, plane1TexCoord).r, texture(plane2Texture, plane2TexCoord).ga);
+ vec3 YUV = vec3(texture(plane1Texture, texCoord).r, texture(plane2Texture, texCoord).ga);
fragColor = ubuf.colorMatrix * vec4(YUV, 1.0) * ubuf.opacity;
}