Catalyzes the irreversible NAD(P)-dependent non-phosphorylating oxidation of glyceraldehyde-3-phosphate (GAP) to 3-phosphoglycerate (3PG). It is highly specific for D-GAP. D-glyceraldehyde 3-phosphate + H2O + NADP(+) = (2R)-3-phosphoglycerate + 2 H(+) + NADPH D-glyceraldehyde 3-phosphate + H2O + NAD(+) = (2R)-3-phosphoglycerate + 2 H(+) + NADH Allosterically activated by AMP, ADP, glucose 1-phosphate (G1P), and fructose 6-phosphate (F6P). Homotetramer. Dimer of dimers. Belongs to the aldehyde dehydrogenase family.