First, you may want to start printing gl_FragCoord.x / 2732.0f to see if you actually get a black to white gradient; the resolution may be different from what you expect. And be sure you've declared gl_FragCoord as highp.
Second, when floating point precision begins to have problems, it will start by eliminating odd numbers and preserving even numbers. This is extremely suspicious.
I wouldn't be surprised if by oversight gl_FragCoord.x doesn't have enough precision to represent the entire iPad Pro's resolution. See Precision limitations on integer values.
Thanks Matias for the reply.
I have tried experimenting with resolution values. I do not know how to get the gradients but resolution is correct.
I tried like below, and it's ok
highp float xpos = floor(gl_FragCoord.x) ;
if (xpos <= 2048.0)
gl_FragColor = // red;
else if (xpos > 2048.0 && xpos < 2500.0)
gl_FragColor = // green;
else
gl_FragColor = // blue;
But if I use mod operation as below, then it fails above 2048. I just want to check odd and even check.
highp float xpos = floor(gl_FragCoord.x) ;
if(mod(xpos, 2.0) == 0.0)
gl_FragColor = // red;
else
gl_FragColor = // green;
Very difficult to understand why. If I assign values directly to xpos even beyond 2048. Then program works ok.
highp float xpos = 2050.0; // 2051.0, 2052.0
if(mod(xpos, 2.0) == 0.0)
gl_FragColor = // red;
else
gl_FragColor = // green;
Thanks
Edit : And this works ok in iPad Pro simulator