I have a very simple GLSL shader that works fine on my desktop, but is crashing when I try and run it on my laptop. I have no idea why - my laptop seems to be expecting the texture() function to return a float.
The error is
Fragment shader failed to compile with the following errors:
ERROR: 0:12: 'texture' : no matching overloaded function found
ERROR: 0:12: '=' : cannot convert from 'const float' to '4-component vector of float'
ERROR: 2 compilation errors. No code generated.
The shader is:
uniform sampler2D u_tex0;
uniform float u_opacity;
uniform int u_type;
varying vec4 v_texCoord;
void main()
{
//Circle centered on origin
float dist = u_type == 0 ? v_texCoord.x : length(v_texCoord.xy);
vec2 src = vec2(dist, 0);
vec4 col = texture(u_tex0, src);
gl_FragColor = vec4(col.r, col.g, col.b, col.a * u_opacity);
}