micro optimizations for gl state