-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
Fallback to OpenGL 3 if other rendering drivers are not supported #97142
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
Conversation
|
This might solve godotengine/godot-proposals#8006, but it should support all platforms, not just Windows. I support the idea in general, I think this is indeed needed to better handle users who don't support modern graphics APIs. |
I will try to do this for other platforms later |
Metal support is only available on Apple Silicon hardware, but most Intel Macs have Vulkan support through MoltenVK. That said, old Intel Macs can't run Vulkan through MoltenVK due to missing hardware features, so the Vulkan -> OpenGL fallback would still be needed on macOS. The same goes for iOS - old devices can't run Vulkan through MoltenVK either: #74227 |
Understood |
|
The code looks good, but when I test locally (with modifications to make I'm investigating further now. |
|
I figured out the issue, the fallback code wasn't setting the rendering_method, therefore, any calls to We don't use the current rendering method often, but we do check it when rendering to ensure that the opengl context is bound to the correct window: godot/servers/rendering/renderer_viewport.cpp Lines 261 to 264 in 694d3c2
In the editor, this code wouldn't get called. So the "loading" popup would take the openGL context and then not return it leading to the main screen never updating. So it wasn't a deadlock after all! The solution is to set the rendering_method at the same time that we set the driver: |
|
Fixed |
clayjohn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! The final step before merging is to squash all the commits together so that the whole PR only contains 1 big commit with all your changes. We like to merge one commit at a time to keep the git history clean and navigable.
If you don't know how to do that, we have a helpful tutorial in the official documentation https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#the-interactive-rebase
|
Everything should be okay now I think |
clayjohn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, looks great! Thank you
|
Thanks! And congrats for your first merged Godot contribution 🎉 |
|
I would like to note that I have had several users who need compatibility mode to play my game (their GPUs do not support Vulkan), and they are simply seeing the game crash once opened (through Steam), unless the parameters "--rendering-driver opengl3" are ran manually. I can't replicate this myself nor have access to their machines to see the problem, so I'm sorry I can't be more helpful, but I thought I would note it here (and see if anyone else is having the same issue). What I do have is one of their Godot.log error logs, it appears to try to default to "Direct3D 12"? This code block is followed by another 300 or so shader error lines. |
|
@joelldt The fallback works for devices that don't have support for Vulkan of D3D12, but it looks like that device supports D3D12, but there is something broken in the implementation which causes Godot to crash |
Add an option to allow renderer fall back to OpenGL 3 if Vulkan (and D3D12 on Windows, Metal on Apple devices) are not supported
Free players from using
--rendering-driver opengl3manuallyFree developers from recieving "Why my game crashed with a message that I can't understand"
Bugsquad edit: