Expected result when overflowing a lowp variable?

I am simply curious about this…





On the iPhone Simulator if I use a lowp variable to accumulate a colour result, in something like a “god ray” or blur shader I get a saturated result, ultimately. No matter how many reasonable iterations I carry out.





On iOS devices, however, I get a ‘0’ result, which I can only assume is because of some kind of overflow situation. Replacing the lowp with a medium solves the problem.





I don’t mind which happens, and can see reasons for either.


I am just curious as to what the “expected” result is from Imagination’s perspective…scratt2011-02-16 09:20:44

You should get a saturated result. Can you post the shader you are using?

Sorry, that particular iteration of the fragment shader went in the bin.





It is fairly easy to replicate, and is basically a lowp vec3 (initially defined outside of a loop) accumulating lots of lowp vec3 texture reads inside that loop with about 20 - 40 iterations.





I have filed a bug report with Apple, and been asked for a reproducer.


When I do that for Apple I will put a copy in this thread also.scratt2011-02-18 04:46:09