The Adreno drivers have a issue with compiling GLSL shaders with a function define in them. It errors out with "unexpected EOF"
Even the most simple pixel shader error doesn't work.
Simple Example
varying highp vec2 uv0;
uniform sampler2D Texture;#define saturate(x) clamp(x, 0.0f, 1.0f)void main() {gl_FragColor = saturate(texture2D(Texture, uv0));};
Hope you guys fix this.
Hi...
We're aware of this compiler error and have a fix in the works. You can workaround it by removing the floating point suffixes (use 1.0 instead of 1.0f)
Thanks
In addition to the first issue in this post, I've hit another issue with function defines again.
with either of the following function defines in a GLSL ES 3 shader and them being used in the shader, it'll fail to compile and I can't see why since the drivers max at 1024 bytes returned for the shader info log
#define frac(x) fract(x)
#define lerp(x, y, z) mix(x, y, z)
changing these function defines to the following makes it work, but then they really aren't function defines
#define frac fract
#define lerp mix
Hope this can be rectified in future drivers sooner rather than later.
Hi..
These parsing problems may have been fixed in a more recent Adreno driver. Can you provide information that is written to the android logcat regarding the Adreno driver (e.g. during eglInitialize), and also let us know what device you are running on?
Also are you able to try on any other Snapdragon/Adreno devices?
thanks
Took me a while to get back on this.
I believe there may be a parsing problem in our shader compiler that was just fixed. Can you try removing the floating point "f" suffix and see if that fixes the problem?