Problem with precision qualifiers in a shader for android

120 views Asked by At

I had a problem rendering with a shader for Android on Löve2d due to the precision of the floats, so I wanted to add these precompilation instructions so that the floats are automatically highp if possible.

#ifdef GL_ES 
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif

But I get this error:

ERROR: highp : overloaded functions must have the same parameter precision qualifiers for argument 1
ERROR: highp : overloaded functions must have the same parameter precision qualifiers for argument 3
ERROR: highp : overloaded functions must have the same parameter precision qualifiers for argument 4

Which matches this line:

vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords)

My question is why and how to fix it? Because on the examples I saw on the Löve2d forum it seemed to work.

The version of OpenGL ES on the device that produces this error is 3.2 if that helps.

0

There are 0 answers