Blackberry: Workaround for GLSL compiler bug.
authorFabian Bumberger <fbumberger@rim.com>
Fri, 9 Nov 2012 13:10:27 +0000 (14:10 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 9 Nov 2012 16:11:07 +0000 (17:11 +0100)
Change-Id: If3ce968c0a0a2af4244671fe028a560843c9016a
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
src/particles/qquickcustomparticle.cpp
src/particles/qquickimageparticle.cpp

index 83eb8c0..80e2118 100644 (file)
@@ -60,7 +60,12 @@ static const char qt_particles_template_vertex_code[] =
         "    highp float size = qt_ParticleData.z;\n"
         "    highp float endSize = qt_ParticleData.w;\n"
         "    highp float t = (qt_Timestamp - qt_ParticleData.x) / qt_ParticleData.y;\n"
+#if !defined(Q_OS_BLACKBERRY)
         "    highp float currentSize = mix(size, endSize, t * t);\n"
+#else
+        "    highp float mixWorkaround = (endSize - size) * t * t;\n"
+        "    highp float currentSize = mixWorkaround + size;\n"
+#endif
         "    if (t < 0. || t > 1.)\n"
         "        currentSize = 0.;\n"
         "    highp vec2 pos = qt_ParticlePos\n"
index 4f8c5a0..1ba9192 100644 (file)
@@ -127,7 +127,12 @@ static const char vertexShaderCode[] =
     "#elif defined(DEFORM)\n"
     "        fTex = vPosTex.zw;\n"
     "#endif\n"
+#if !defined(Q_OS_BLACKBERRY)
     "        highp float currentSize = mix(vData.z, vData.w, t * t);\n"
+#else
+    "        highp float mixWorkaround = (vData.w - vData.z) * t * t;\n"
+    "        highp float currentSize = mixWorkaround + vData.z;\n"
+#endif
     "        lowp float fade = 1.;\n"
     "        highp float fadeIn = min(t * 10., 1.);\n"
     "        highp float fadeOut = 1. - clamp((t - 0.75) * 4.,0., 1.);\n"