Describe the problem or limitation you are having in your project
If the graphics driver restarts, which on Windows this may happen from updating the graphics driver, or from a timeout detection and recovery (TDR), the Godot editor or any Godot games will either freeze or crash.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Handling a graphics driver restart gracefully, should allow the Godot editor and most Godot games to recover from a driver restart instead of freezing or crashing.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
DirectX (D3D12, DXGI): Certain calls will return DXGI_ERROR_DEVICE_REMOVED to indicate a driver reset. On receiving this error, Godot will need to destroy and recreate the D3D12 device, swap chain, and related resources.
OpenGL: GL_ARB_robustness / GL_KHR_robustness shouldallow Godot to detect graphics driver restarts. On receiving GL_CONTEXT_LOST, Godot will need to create a new OpenGL context and related resources.
WebGL: Godot will need to handle the webglcontextlost and webglcontextrestored events and recreate the related resources.
Describe the project you are working on
Godot editor.
Describe the problem or limitation you are having in your project
If the graphics driver restarts, which on Windows this may happen from updating the graphics driver, or from a timeout detection and recovery (TDR), the Godot editor or any Godot games will either freeze or crash.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Handling a graphics driver restart gracefully, should allow the Godot editor and most Godot games to recover from a driver restart instead of freezing or crashing.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
DXGI_ERROR_DEVICE_REMOVED
to indicate a driver reset. On receiving this error, Godot will need to destroy and recreate the D3D12 device, swap chain, and related resources.VK_ERROR_DEVICE_LOST
?GL_ARB_robustness
/GL_KHR_robustness
shouldallow Godot to detect graphics driver restarts. On receivingGL_CONTEXT_LOST
, Godot will need to create a new OpenGL context and related resources.webglcontextlost
andwebglcontextrestored
events and recreate the related resources.Testing:
dxcap.exe
tool. Runningdxcap -forcetdr
forces a TDR. (https://learn.microsoft.com/en-us/windows/uwp/gaming/handling-device-lost-scenarios#testing-device-removed-handling)WEBGL_lose_context
andWEBGL_lose_context
can be used to simulate losing and restoring the WebGL context.If this enhancement will not be used often, can it be worked around with a few lines of script?
No, it has to be integrated into the rendering drivers.
Is there a reason why this should be core and not an add-on in the asset library?
It has to be integrated into the rendering drivers.