I remember I had this problem after a fresh install of Windows 10 a few years ago...
I'm not exactly sure how I fixed it but, the problem was gone after I installed the latest driver for the graphics card and also the directx runtime.
But I'm sure I downloaded the official installers from Nvidia and Microsoft.