Shader compatibility error (SOLVED)

I get this error when bundling macOS

Warning! Compatability issue: \Users\Brian\AppData\Local\Temp\font-gradient.fpc1466291630736356298.glsl:          "precision mediump int; precision highp float;"
C:\Users\Brian\AppData\Local\Temp\font-gradient.fpc1466291630736356298.glsl:21: error: 'texture' : can't use function syntax on variable
C:\Users\Brian\AppData\Local\Temp\font-gradient.fpc1466291630736356298.glsl:21: error: '=' :  cannot convert from ' const float' to ' temp lowp 4-component vector of float'
2 errors generated.

What’s wrong here?

varying mediump vec2 var_texcoord0;
varying lowp vec4 var_face_color;
varying lowp vec4 var_outline_color;
varying lowp vec4 var_shadow_color;

uniform lowp vec4 texture_size_recip;
uniform lowp sampler2D texture;

uniform lowp vec4 color1;
uniform lowp vec4 color2;

vec3 gradient_mode()
{
    lowp float gradient_value_y = fract(var_texcoord0.y / texture_size_recip.w);
    lowp vec3  color_a          = color1.rgb;
    lowp vec3  color_b          = color2.rgb;

    return mix(color_a,color_b,gradient_value_y);
}

void main()
{
    lowp vec4  cache_sample  = texture2D(texture, var_texcoord0.xy);
    lowp vec3 gradient_norml = gradient_mode();

    gl_FragColor = vec4(gradient_norml,1.0) * cache_sample.x;
}
1 Like

I had some font .fp where I had not updated them since the texture change.

Changed “texture” to “texture_sampler” and the error went away.

3 Likes