Controls on primary porosity and permeability development in igneous rocks