diff options
author | Massimo Callegari <massimocallegari@yahoo.it> | 2018-08-24 23:41:13 +0200 |
---|---|---|
committer | Massimo Callegari <massimocallegari@yahoo.it> | 2018-09-03 12:26:39 +0000 |
commit | f844a2acbb7ecc4d7b1776d1d6eeb8feab7044f1 (patch) | |
tree | b6081a7e762789765750703d273f930ccbf0de42 /src/qtmultimediaquicktools/shaders/triplanaryuvvideo_core.vert | |
parent | c1ca9510af3c3c4134b717f1863651783e338a9e (diff) |
Add OpenGL core profile support to QtMultimediaQuickTools
When requesting a OGL Core profile via QSurfaceFormat::setDefaultFormat (e.g. to use Qt3D advanced features),
it is no longer possible to render QML Video items. This is because the requested shaders should be _core versions.
This patch adds the core shaders so QtMultimedia stops whining, and bind textures with the proper
format, since GL_LUMINANCE and GL_LUMINANCE_ALPHA are no longer valid in OGL 4.
Task-number: QTBUG-51064
Change-Id: I909e01e7dc7be07549e9ecf0a6425b309af38ea1
Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src/qtmultimediaquicktools/shaders/triplanaryuvvideo_core.vert')
-rw-r--r-- | src/qtmultimediaquicktools/shaders/triplanaryuvvideo_core.vert | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/qtmultimediaquicktools/shaders/triplanaryuvvideo_core.vert b/src/qtmultimediaquicktools/shaders/triplanaryuvvideo_core.vert new file mode 100644 index 000000000..ebf3604e1 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders/triplanaryuvvideo_core.vert @@ -0,0 +1,17 @@ +#version 150 core +uniform mat4 qt_Matrix; +uniform float plane1Width; +uniform float plane2Width; +uniform float plane3Width; +in vec4 qt_VertexPosition; +in vec2 qt_VertexTexCoord; +out vec2 plane1TexCoord; +out vec2 plane2TexCoord; +out vec2 plane3TexCoord; + +void main() { + plane1TexCoord = qt_VertexTexCoord * vec2(plane1Width, 1); + plane2TexCoord = qt_VertexTexCoord * vec2(plane2Width, 1); + plane3TexCoord = qt_VertexTexCoord * vec2(plane3Width, 1); + gl_Position = qt_Matrix * qt_VertexPosition; +} |