GLSL optimization. What is faster?
<p>I'm using OpenGL ES.
And have two types of calculation "dir" vector, which code is fastest?</p>

<pre><code>attribute vec2 order;
</code></pre>

<p>code1:</p>

<pre><code>  if( abs(sinA) &lt; 0.2 ) {
    if(order.x == 1.0){
        dir = sNormalPrev;   
    } else {
        dir = sNormalNext;   
    }
  } else {
    dir *= order.x / sinA;
  }
</code></pre>

<p>code 2:</p>

<pre><code>float k = step(0.2, abs(sinA));
dir = k * dir * order.x / sinA - (k-1.0) * (step(1.0, order.x + 1.0) * sNormalPrev + step(1.0, -order.x + 1.0) * sNormalNext);
</code></pre>