Pattern formation, photonic spin-orbit coupling and topological states in semiconductor microcavities and micropillar lattices