The process of mineral formation from magma is called