Also known as G1PDH_METM5, egsA. Catalyzes the NAD(P)H-dependent reduction of dihydroxyacetonephosphate (DHAP or glycerone phosphate) to glycerol 1-phosphate (G1P). The G1P thus generated is used as the glycerophosphate backbone of phospholipids in the cellular membranes of Archaea.