Corrupted state after closing build while profiling. Now no unity build runs

I was using the Profiler and the Frame Debugger on a Windows build, but after I closed the game something got corrupted and none of my builds, whether the one I was testing or any of the previous ones run anymore.

All I get is a grey square in the middle of the screen when the Unity splashcreen should be appearing, and just black after that. In the console, I get a long list of “Render Graph Execution” errors.

I tried deleting the Library folder, clearing the shader cache of the GPU, reinstalling GPU drivers, and deleting the registries of my game and nothing seems to fix it. The Editor though seems to be working fine.

I would appreciate the help since I’m stuck unable to work.
Thanks

I narrowed down a bit more the problem and it seems that after the issue happened, when I call Screen.currentResolution from the Windows build, the result says is 1x1. From the Editor returns the correct one.

image

Any idea what is going on?

Reboot? Could be a driver fault.

Yes, I have tried the traditional “turn it off and on again” ;). I also reinstalled the GPU driver with no different result.

Luckily I found the solution. In my code, I was relying on those calls for the fallbacks in case something was unexpected, and when those called returned wrong values, it entered a loop of corrupted saved states, incorrect windows registries, and unhandled exceptions that made everything explode.

I deleted from my code the reliance on Screen.currentResolution to determine the desktop resolution at runtime, and clean up a bunch of stuff and I’m back on running.