glyceraldehyde-3-phosphate dehydrogenase [NAD(P)+] (phosphorylating) activity of GAPA (LOC_OS04G38600.1) [plastid stroma]