Fix x4121 warnings

Fix warning `X4121: gradient-based operations must be moved out of flow
  control to prevent divergence. Performance may improve by using a non-gradient operation`

- This fix also give small amount of fps boost for Windows Chrome (about 2-5 fps faster with three.js/examples/webgl_gpgpu_birds.html#128)