In a recent shader, I wrote this line:
float lum = T * vec4(0.21, 0.72, 0.07, 0);
where T is a vec4.
This line works perfectly on NVIDIA GLSL compiler but generates an error on AMD compiler:
ERROR: 0:78: '=' : cannot convert from '4-component vector of float' to 'float'
The error produced by AMD GLSL compiler is correct and NVIDIA should do the same thing. Weirdly, the shader works properly and the rendering was the one expected on NVIDIA GPUs.
The right code is:
float lum = dot(T, vec4(0.21, 0.72, 0.07, 0));
which is ok on all graphics hardware!