quad and tri shader optimizations, thx to Loffe