  We present a calculation of the NLO QCD corrections to the loop-induced
production of a photon pair through gluon fusion, including massive top quarks
at two loops, where the two-loop integrals are calculated numerically. Matching
the fixed-order NLO results to a threshold expansion, we obtain accurate
results around the top quark pair production threshold. We analyse how the top
quark threshold corrections affect distributions of the photon pair invariant
mass and comment on the possibility of determining the top quark mass from
precision measurements of the diphoton invariant mass spectrum.
