GLSL bug?

Is this a GLSL bug, or am I missing something?

gl_FragColor = vec4(mat2(1.0));
=> compiles and works fine

float f = 1.0;
gl_FragColor = vec4(mat2(f));
=> error C1035: assignment of incompatible types (2nd line)



No, those should not be different. But you didn’t tell us what drivers, GPU, etc you were running.

Plus, I’d say that the vec4(mat2) conversion is sufficiently rarely used that implementations don’t regularly test for it. Try to stay away from areas that are off the beaten path.