When are you buying the new cpu? Maybe wait until the 9000 series x3d comes out if you can... though it will he sought after and pricey.
But yeah, if not, the 7800x3d is the better gaming cpu. But to get those frames at 2560x1440, you'll need a good gpu... 4070 super or 7900xt or better (I see 7900xtx in the title, now). If I'm spending ~$900 today on a GPU for 2560x1440, it's the 4080 Super. 7900XTX is a performant card, but, uses a lot more power than the 4080S and is notably worse at ray tracing. The new AMD cards will be better there, but not sure how fast they will be as AMD won't be competing at the top end next gen....new gpus are coming out early 2025, so....depends on what and when you needs are.