Display stops updating

The game is still running and the mouse cursor still works, but all graphics are frozen. I can kill enemies by random clicking and the cursor will change to a red sword over an enemy which helps.

If I ALT-TAB and select D4, then the display updates start happening again. I don’t need to switch to another application, just using ALT-TAB and switching straight to D4 works.

I have an AMD Radeon RX 6900 XT GPU and AMD Ryzen 7 3700X CPU.