I am using a static branch to predicate skinning in my vertex shaders. If I set the predicate (I have tried every variable type) to false the vertex shading cost doesn’t change. It seems the vertices are skinned regardless of the predicate and the predicate is simply used to choose the result. This lead me to believe that despite the docs confirming that both static and dynamic branching are supported (SGX on iOS) they are in fact not supported. Then I played around with a light loop in a fragment shader and did get what I would expect when changing the light count. Do I have to do something special to get the static branch working in the vertex shader? Is there a way to access some kind of compiler output? The nice thing about offline compilers is that you can confirm your suspicions by review the output of the compiler, I am hoping that there is some way to do this with your hardware (this has kept me out of the GLSL camp for awhile now, but there isn’t any other option for iOS).
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Cost of 'static' branches in SGX shaders? | 5 | 304 | April 23, 2010 | |
Sorting float array in fragment shader without causing dynamic branches in OpenGL ES 2.0 (iPad 3) | 7 | 1352 | April 11, 2013 | |
developing on gentoo - shader compile or link fail | 5 | 330 | May 28, 2012 | |
are vertex shaders without attributes toxic? | 6 | 300 | November 9, 2010 | |
Offline OpenGL ES compiler | 3 | 953 | August 2, 2016 |