glsl: Add an optimization pass to flatten simple nested if blocks.