Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle and recover from graphics driver restart gracefully #10269

Open
alvinhochun opened this issue Jul 23, 2024 · 1 comment
Open

Handle and recover from graphics driver restart gracefully #10269

alvinhochun opened this issue Jul 23, 2024 · 1 comment

Comments

@alvinhochun
Copy link

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

  • 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.
  • Vulkan: Unsure, robably by handling VK_ERROR_DEVICE_LOST?
  • Metal: ?
  • 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.

Testing:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants