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 | 305 | April 23, 2010 | |
Sorting float array in fragment shader without causing dynamic branches in OpenGL ES 2.0 (iPad 3) | 7 | 1395 | April 11, 2013 | |
simple but slow Shader? | 5 | 294 | April 27, 2010 | |
ES2.0 Fragment shader compile failed without any errors or warnings | 3 | 545 | January 10, 2014 | |
Shader Compiler on Samsung Galaxy S, Samsung S9000, Samsung S9100 | 7 | 391 | November 25, 2013 |