The commitment of cells to specific cell fates of the endoderm, ectoderm, or mesoderm as a part of gastrulation.