summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergio Martins <sergio.martins@kdab.com>2017-08-25 13:51:09 +0100
committerSean Harmer <sean.harmer@kdab.com>2017-08-25 13:05:12 +0000
commitad58631a946cd733a34b04634270eb1ac74941bc (patch)
treec3e4e404456e9318cafe96110b2ebff5a75d0da5
parentd34bc92a44240153a61438de2e30fa6f946e6a4c (diff)
Fix shader linking error on RPI/BRCM
QOpenGLShader::link: ERROR:OPTIMIZER-3 (fragment shader, line 46) Support for for loops is restricted : right side of condition expression must be constant Task-number: QTBUG-59349 Change-Id: Id5806e597642e0805ef02fa1804ec4a9a8e4338c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/extras/shaders/es2/light.inc.frag12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/extras/shaders/es2/light.inc.frag b/src/extras/shaders/es2/light.inc.frag
index 074af5799..57a30036f 100644
--- a/src/extras/shaders/es2/light.inc.frag
+++ b/src/extras/shaders/es2/light.inc.frag
@@ -27,7 +27,9 @@ void adsModelNormalMapped(const in FP vec3 vpos, const in FP vec3 vnormal, const
FP vec3 s, ts;
Light light;
- for (int i = 0; i < lightCount; ++i) {
+ for (int i = 0; i < MAX_LIGHTS; ++i) {
+ if (i >= lightCount) // Make brcm happy with the for loop
+ break;
if (i == 0)
light = lights[0];
else if (i == 1)
@@ -94,7 +96,9 @@ void adsModel(const in FP vec3 vpos, const in FP vec3 vnormal, const in FP vec3
FP vec3 s;
Light light;
- for (int i = 0; i < lightCount; ++i) {
+ for (int i = 0; i < MAX_LIGHTS; ++i) {
+ if (i >= lightCount) // Make brcm happy with the for loop
+ break;
if (i == 0)
light = lights[0];
else if (i == 1)
@@ -151,7 +155,9 @@ void adModel(const in FP vec3 vpos, const in FP vec3 vnormal, out FP vec3 diffus
FP vec3 s;
Light light;
- for (int i = 0; i < lightCount; ++i) {
+ for (int i = 0; i < MAX_LIGHTS; ++i) {
+ if (i >= lightCount) // Make brcm happy with the for loop
+ break;
if (i == 0)
light = lights[0];
else if (i == 1)