diff options
author | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-06-04 16:31:22 +0200 |
---|---|---|
committer | VaL Doroshchuk <valentyn.doroshchuk@qt.io> | 2020-06-04 18:40:03 +0200 |
commit | cf815557eef1d1d34e20d13df24baae5e2f138ac (patch) | |
tree | 6a96e21bef8ba08c08dac0be36dbc065bbaef4f7 /src/qtmultimediaquicktools/shaders/yuv.vert | |
parent | 0e3b08d2b8cec6b6489cb99de3f58d1ccdb439d8 (diff) |
RHI: Remove gl code from video nodes
Now QSGMaterialShader handles rhi textures too.
Task-number: QTBUG-78678
Change-Id: I410185c80bd104741fd5b52deeb87eb97531410a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/shaders/yuv.vert')
-rw-r--r-- | src/qtmultimediaquicktools/shaders/yuv.vert | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/qtmultimediaquicktools/shaders/yuv.vert b/src/qtmultimediaquicktools/shaders/yuv.vert new file mode 100644 index 000000000..6f103372f --- /dev/null +++ b/src/qtmultimediaquicktools/shaders/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; +} |