We regard the work of Maulik and Toda, proposing a sheaf-theoretic approach to Gopakumar–Vafa invariants, as defining a BPS structure, that is, a collection of BPS invariants together with a central charge. Assuming their conjectures, we show that a canonical flat section of the flat connection corresponding to this BPS structure, at the level of formal power series, reproduces the Gromov–Witten partition function for all genera, up to some error terms in genus 0 and 1. This generalises a result of Bridgeland and Iwaki for the contribution from genus 0 Gopakumar–Vafa invariants.