Repository: godot
Issue: Vulkan: Crash has caused persistent vkEnumeratePhysicalDevices failure
Labels: bug,topic:rendering,crash

### Godot version

v4.0.alpha7.official.3e9ead05f

### System information

Windows 10, Vulkan, nvidia geforce gtx 1660Ti

### Issue description

In summary, I've previously been able to run 4.0 alphas up to and including 7, as well as various custom builds. One of my custom builds crashed and now I can't run any version of 4.0.

***

I left a custom build running when I put my computer to sleep. The build crashed on waking up. I didn't think this was too exceptional, so don't remeber what errors, if any, were shown. I then compiled the build with a minor change and tried to run it (using `-e` to open a project directly), which produced this error popup:

![image](https://user-images.githubusercontent.com/61291296/166680688-300b8dab-37a8-4d25-93c6-a52f92b04940.png)

Now I can no longer run the official alphas either - they produce the same error before reaching the project manager. Running from the command line additionally gives 

```
Godot Engine v4.0.alpha7.official.3e9ead05f - https://godotengine.org
ERROR: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        setup_loader_tramp_phys_devs:  Failed during dispatch call of 'vkEnumeratePhysicalDevices' to lower layers or loader to get count.
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 1309168
   at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:159)
ERROR: vkEnumeratePhysicalDevices reported zero accessible devices.

Do you have a compatible Vulkan installable client driver (ICD) installed?
vkEnumeratePhysicalDevices Failure
   at: (drivers/vulkan/vulkan_context.cpp:807)
ERROR: Condition "err != OK" is true. Returning: ERR_CANT_CREATE
   at: _window_create (drivers/vulkan/vulkan_context.cpp:1369)
```
Following the advice in #58927, I've run alpha7 with `--rendering-driver opengl3` and `--single-window`. This lets me open the project manager, but I get the same crash as usual when I try to open any project (including a newly created one). Output:

```
C:\Users\harry\OneDrive\Desktop>
Godot Engine v4.0.alpha7.official.3e9ead05f - https://godotengine.org
OpenGL Renderer: NVIDIA GeForce GTX 1660 Ti/PCIe/SSE2

ERROR: Condition "t->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
ERROR: Condition "t->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
ERROR: Condition "t->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
Editing project: C:/Users/harry/OneDrive/Desktop/empty_test (C:::Users::harry::OneDrive::Desktop::empty_test)
ERROR: Condition "t
->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
ERROR: Condition "t->render_target" isG otrdouet.
E n g iante:  vt4e.x0t.uarlep_hfar7e.eo f(fdirciivaelr.s3/eg9leeasd30/5sft o-r ahgtet/ptse:x/t/ugroed_ostteonrgaignee..coprpg:
723)
ERROR: Condition "t->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
. . . *Error message repeated*
ERROR: Condition "t->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
ERROR: GENEERRRAOLR :-  MCeosnsdaigtei oInd  "Ntu-m>breern:d e0r _|t aMregsesta"g ei sI dt rNuaem.e
:   L oaatd:e rt eMxetsusraeg_ef
r       esee t(udpr_ilvoeardse/rg_ltersa3m/ps_tpohryasg_ed/etvesx:t u rFea_islteodr adguer.icnpgp :d7i2s3p)a
tch cEaRlRlO Ro:f  'CvoknEdniutmieorna t"etP-h>yrseincdaelrD_etvaircgeest'"  tios  ltorwueer.
la y e rast :o rt elxotaudreer_ ftroe eg e(td rciovuenrts./
g       lOebsj3e/csttso r-a g1e
/       t       eOxbtjuercet_[s0t]o r-a gVeK._cOpBpJ:E7C2T3_)T
YPE_EIRNRSOTRA:N CCEo,n dHiatnidolne  "2t1-9>0r8e6n9d7e6r
_t a r gaett:"  _idse bturgu_em.e
ss e n gaetr:_ catlelxbtaucrke _(fdrreiev e(rdsr/ivvuelrksa/ng/lveusl3k/asnt_ocroangtee/xtte.xctpupr:e1_5s9t)o
ragEeR.RcOppR::72 3v)k
EnuEmReRrOaRt:eP hCyosnidciatliDoenv i"cte-s> rreenpdoerrt_etda rzgeerto"  aicsc etsrsuieb.l
e   d eavti:c etse.x
t
uDroe _yforue e h(advrei vae rcso/mgplaetsi3b/lset oVrualgkea/nt eixntsutrael_lsatbolrea gcel.icepnpt: 7d2r3i)v
erE R(RIOCDR): i nCsotnadlilteido?n
 v"ktE-n>urmeenrdaetre_Pthayrsgiecta"l Diesv itcreuse .F
ai l u raet
:  t e xattu:r e(_dfrrievee r(sd/rviuvlekrasn//gvluelsk3a/ns_tcoornatgeex/tt.ecxptpu:r8e0_7s)t
oraEgReR.OcRp:p :C7o2n3d)i
tion "err !E=R ROOKR": i sC otnrduiet.i oRne t"utr-n>irnegn:d eErR_Rt_aCrAgNeTt_"C RiEsA TtEr
ue .
 a t :  a_tw:i ntdeoxwt_ucrree_aftree e( d(rdirvievresr/sv/ugllkeasn3//vsutlokraang_ec/otnetxetxutr.ec_pspt:o1r3a6g9e).
cpp:723)
ERROR: Condition "t->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
. . . *Error message repeated*
ERROR: Condition "t->render_target" is true.
   at: texture_free (drivers/gles3/storage/texture_storage.cpp:723)
ERROR: 71 RID allocations of type 'PN5GLES37TextureE' were leaked at exit.
```
(where I've skipped some lines of repeated error messages).

I've restarted/updated my drivers, but the problem persists. The custom build I was running only contained fairly simple changes to how tab history is saved in the editor, so I imagine the cause of the problem was the crash after waking up from sleep.

### Steps to reproduce

I can't reproduce whatever caused the initial crash, because 4.0 won't run at all for me any more.

### Minimal reproduction project

_No response_