mediump float UnPackRGBAToFloat(const mediump vec4 v)
{
const mediump vec4 vTest = vec4(1.0);
const mediump vec4 vBitShift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
return (dot(v, vBitShift));
}
void main()
{
const mediump vec4 vBitShift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
return (dot(v, vBitShift));
}
void main()
{
gl_FragColor = vec4(1.0);
}
}
which outputs 'Compile failed', but doesn't explain why...
If I comment out 'const' keyword(red only) like
mediump float UnPackRGBAToFloat(const mediump vec4 v)
{
{
const mediump vec4 vTest = vec4(1.0);
mediump vec4 vBitShift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
mediump vec4 vBitShift = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
......
which outputs 'Success'...
I don't know why...