I am currently pursuing some bugs in my shader code for the OpenGL ES 2.0 fragment that works on iOS devices. The code works fine in the simulator, but it has huge problems on the iPad, and some of the calculations give completely different results, for example, I had t20> on the iPad and 4013.17 on the simulator, so I'm not talking about small differences that may be the result of some rounding errors.
One of the things that I noticed is that on the iPad,
float1 = pow(float2, 2.0);
can give results that are very different from the results
float1 = float2 * float2;
In particular, when using pow(x, 2.0) for a variable containing a larger negative number, for example -8 , it returned a value that met the condition if (powResult <= 0.0) .
In addition, the result of both operations ( pow(x, 2.0) , as well as x*x ) gives different results in the simulator than on the iPad.
The floats used are mediump , but I get the same with highp .
Is there a simple explanation for these differences?
I judge the problem, but it takes a lot of time, so maybe someone can help me here with a simple explanation.