Imagination Technologies has posted a brief tutorial on how to optimize flow control and branching in your shaders for the PowerVR GPU. PowerVR hardware supports flow control in both vertex and fragment shaders by default, without having to explicitly enable any extensions.
The tutorial provides an introduction to flow control using a Gaussian Blur as an example, before providing recommendations for PowerVR GPUs, including:
- Avoid using discard in conditional branches
- Avoid sampling textures in conditional branches
- Try to use branching to skip unnecessary operations
The tutorial also discusses how to optimize shaders for OpenGL ES 3.0 using the GL_EXT_shader_group_vote extension.
Check out the full guide here.