sgx530 fails to compile shader - works on others.

Hi,





I have this shader code.





if (lit != true){





highp vec4 sce= texture2D(inSampler0, vec2(swd.s - offset, swd.t - offset));


if (dot(swd.xyzw,ndm) > nd) lum+= 1.0;


sce= texture2D(inSampler0, vec2(swd.s, swd.t - offset));


if (dot(swd.xyzw,ndm) > nd) lum+= 1.0;


sce= texture2D(inSampler0, vec2(swd.s + offset, swd.t - offset));


if (dot(swd.xyzw,ndm) > nd) lum+= 1.0;


sce= texture2D(inSampler0, vec2(swd.s - offset, swd.t));


if (dot(swd.xyzw,ndm) > nd) lum+= 1.0;     





>Any More of the above will fail on the Motorola defys sgx530<





}





I’m sampling for a PCF filter so do the above quite a few times. the problem is the condition, on


every other device I tested sgx540,sgx535,Adreno 220,Tegra2 across quite a few devices (6 + PC) I can have as many texture reads as I want inside that condition.





If ran on my defys SGX530 the following compile error happens





"Calls to any function that may require a gradient calculation inside a conditional block may return undefined results" - remove the condition and I can sample as many as I want but add the condition


then more than 4 will give me that error but only on the defy’s sgx530 - I dont have another sgx530


device to test with.





As I said works fine on all my other devices, so I’m edging to the defys compiler - but would like


to know if I’ve missed anything in the code.





I’ve tried many ways to get it to compile (functions, different paths etc) all attempts work fine on the others but as soon as that condition block - defy wont compile.





Would love a suggestion :slight_smile:





Cheers