Android | Shader error
EngineerSmith opened this issue · comments
I get the following error on Android(Samsung TabA), and I managed to patch it. However I'm unable to create a pull request as I'm not able to test it an another platform than Android at the moment to check that it doesn't break anything else. So I've created this here for anyone else who will find it useful.
Line 36: ERROR: 'assign' : cannot convert from ' const int' to ' temp highp float'
Line 36: ERROR: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
Traceback
[C]: in function 'newShader'
lib/g3d/g3d/init.lua:49: in main chunk
[C]: in function 'require'
...
Solution:
line 36 of g3d/g3d.vert change screenPosition.y *= -1;
to screenPosition.y *= -1.0;
Thanks for pointing this out!
It's kinda annoying that different systems have different type coercion rules, and I don't catch them sometimes because I only test on Windows and Mac. I just committed this change, it'll be in the next major version.