title: Android OpenGL ES 2.0: Is "switch-case" syntax possible in GLSL fragment shader on Samsung Galaxy S2?
body: <p>Does anybody know how to do <code>switch</code> <code>case</code> syntax in the fragment shader on the Samsung Galaxy S2? I get the compilation error: <code>Expected literal or '(', got 'switch'</code>.</p>
  
  <p>My syntax is as follows:</p>
  
  <pre><code>switch(i){
      case 0: x = alphas[0]; break;
      case 1: //...etc.
  }
  </code></pre>
  
  <p>This works fine on the Nexus 7, but on the Galaxy S2 I get the above error. Are <code>switch</code> <code>case</code> instructions simply impossible on the Galaxy S2? The reason why I want to use them is they appear to give a performance improvement over <code>if</code> <code>else</code> on the Nexus 7. If they are impossible on the Galaxy S2, is there a way to query the device and use <code>switch</code> <code>case</code> if available, and <code>if</code> <code>else</code> otherwise?</p>