title: Can I get performance gain by putting the codes which hit more often inside if block when writing an if/else branch in a shader program?
body: <p>I learned that gpu can optimize the else block out if the branch condition remains the same in a gpu thread group(a warp or whatever). In my assumption, when gpu is dealing with a branch, it always do the if block first, then the else block. When the if block is done, gpu checks if the condtion expression evals to true on every threads among a thread group. If this is the case, the else block can be skipped in that thread group.</p>
  <p>So I guess that if I put the codes which hit more often inside the if block, I can benefit more from this branch skipping mechanism. Is that true?</p>