clean up and re-ordering in shader code generation to recover some performance lost due to unnecessary work done in the shader generation path. this should bring a descent speed up in all the back ends.