PDA

View Full Version : How to detect that a fragment shader can handle loops



kturkowski
11-19-2013, 05:40 PM
I am writing code that is expected to run on a wide variety of Android and iOS devices, and one of my shaders uses loops. On some GPUs it compiles and runs fine, and sometimes fast. On other devices, it fails to compile, with the message 'profile does not support "for" statements and "for" could not be unrolled.'

How do I determine beforehand that a GPU can handle loops so I can feed a loopy shader; otherwise I will feed it an unrollable shader.
It mentions the "profile" -- can I query that?
Is there perhaps an extension string that can be searched for?

-Ken