running

| qmlcompositor -platform eglfs
| qmlscene -platform wayland foo.qml

causes

QOpenGLShader::compile(Fragment): Compile failed.
ERROR: 0:6: 'float' : No precision defined for this type
ERROR: 0:7: 'vec4' : No precision defined for this type
ERROR: 0:8: 'float' : No precision defined for this type
ERROR: 0:11: 'vec4' : No precision defined for this type
ERROR: 0:12: 'vec3' : No precision defined for this type
ERROR: 0:13: 'vec3' : No precision defined for this type
ERROR: 6 compilation errors. No code generated.

*** Problematic Fragment shader source code ***

    uniform sampler2D source;
    uniform float qt_Opacity;
    uniform vec4 color;
    uniform float blend;
    varying highp vec2 qt_TexCoord0;
    void main() {
        vec4 sourceColor = texture2D(source, qt_TexCoord0);
        vec3 delta = sourceColor.rgb - vec3(0.5);
        vec3 lowerContrast = vec3(0.5) + 0.4 * delta;
        gl_FragColor = qt_Opacity * mix(sourceColor, color * sourceColor.a * 
dot(lowerContrast, vec3(11, 16, 5) * (1. /  32.)), blend);
    }

***

Signed-off-by: Andreas Müller <schnitzelt...@googlemail.com>
---
 ...002-Fix-ConstrastEffect-in-qml-compositor.patch | 48 ++++++++++++++++++++++
 recipes-qt/qt5/qtwayland_git.bb                    |  4 ++
 2 files changed, 52 insertions(+)
 create mode 100644 
recipes-qt/qt5/qtwayland/0002-Fix-ConstrastEffect-in-qml-compositor.patch

diff --git 
a/recipes-qt/qt5/qtwayland/0002-Fix-ConstrastEffect-in-qml-compositor.patch 
b/recipes-qt/qt5/qtwayland/0002-Fix-ConstrastEffect-in-qml-compositor.patch
new file mode 100644
index 0000000..1b40be6
--- /dev/null
+++ b/recipes-qt/qt5/qtwayland/0002-Fix-ConstrastEffect-in-qml-compositor.patch
@@ -0,0 +1,48 @@
+From 309e9b03d24eb6b0b8fff04d883329c2f93a6a1c Mon Sep 17 00:00:00 2001
+From: Pier Luigi Fiorini <pierluigi.fior...@gmail.com>
+Date: Sun, 29 Dec 2013 14:15:41 +0100
+Subject: [PATCH] Fix ConstrastEffect in qml-compositor
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Specify precision to make the shader working.
+
+Change-Id: I055fe47e1073403dc981274236fa82e091e0eca4
+Reviewed-by: Jørgen Lind <jorgen.l...@digia.com>
+Reviewed-by: Andy Nichols <andy.nich...@digia.com>
+Upstream-status: applied
+---
+ examples/qml-compositor/ContrastEffect.qml | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/examples/qml-compositor/ContrastEffect.qml 
b/examples/qml-compositor/ContrastEffect.qml
+index 5159950..c284b29 100644
+--- a/examples/qml-compositor/ContrastEffect.qml
++++ b/examples/qml-compositor/ContrastEffect.qml
+@@ -75,15 +75,15 @@ ShaderEffect {
+     vertexShader: source && source.isYInverted ? vShaderInvertedY : vShader
+ 
+     fragmentShader: "
+-    uniform sampler2D source;
+-    uniform float qt_Opacity;
+-    uniform vec4 color;
+-    uniform float blend;
++    uniform lowp sampler2D source;
++    uniform highp float qt_Opacity;
++    uniform highp vec4 color;
++    uniform highp float blend;
+     varying highp vec2 qt_TexCoord0;
+     void main() {
+-        vec4 sourceColor = texture2D(source, qt_TexCoord0);
+-        vec3 delta = sourceColor.rgb - vec3(0.5);
+-        vec3 lowerContrast = vec3(0.5) + 0.4 * delta;
++        highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
++        highp vec3 delta = sourceColor.rgb - vec3(0.5);
++        highp vec3 lowerContrast = vec3(0.5) + 0.4 * delta;
+         gl_FragColor = qt_Opacity * mix(sourceColor, color * sourceColor.a * 
dot(lowerContrast, vec3(11, 16, 5) * (1. /  32.)), blend);
+     }
+     "
+-- 
+1.8.3.1
+
diff --git a/recipes-qt/qt5/qtwayland_git.bb b/recipes-qt/qt5/qtwayland_git.bb
index 640373e..cf91908 100644
--- a/recipes-qt/qt5/qtwayland_git.bb
+++ b/recipes-qt/qt5/qtwayland_git.bb
@@ -5,3 +5,7 @@ require ${PN}.inc
 # qt5-git PV is only to indicate that this recipe is compatible with qt5 5.2.0
 
 SRCREV = "3e9412e2fd91e64a565ed8ddbef76f57ca9413d5"
+
+SRC_URI += " \
+    file://0002-Fix-ConstrastEffect-in-qml-compositor.patch \
+"
-- 
1.8.3.1

_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Reply via email to