-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Don't create rendering device or parse glsl shader in headless mode #98247
Don't create rendering device or parse glsl shader in headless mode #98247
Conversation
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.
This looks mostly good. Just a bit more feedback to get it fully finished
38efffe
to
c60b3ee
Compare
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 |
c60b3ee
to
41a468d
Compare
41a468d
to
2e1fc24
Compare
done :) Let me know if you need anything else :) |
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! Thank you
You are very welcome! And thank you as well! ❤️ |
Thanks! |
This PR resolves: #98246
It appears that some recent code changes were made that parse glsl shaders in new locations as well as some logic surrounding
DisplayServer::can_create_rendering_device
. Both of which introduced problems when running on a machine that does not have a gpu. This may not be the correct solution so please leave your comments and / or open a different pr with the proper fix. This at least fixed it for me though. Without further ado, here is the explanation for my changes:^ We can't create a DisplayServer in headless mode... at least I don't think we can. I'm mostly going off my intuitive understanding of the word
Display
and regarding the fact that there is no display on a headless server without a gpu. But that is grammatical rather than technical reasoning which I know does not necessarily apply in the world of software.^ Don't try to initalize a new BetsyCompressor in headless mode. I found that for whatever reason, BetsyCompressor was trying to hook into the gpu on my device and crashing if it couldn't find one. This may or may not be the correct solution.
^ This is really the only change that I'm fairly confident in. I actually copied this
ERROR_FAIL
from a different area of code that prevents glsl imports in headless modegodot/editor/import/resource_importer_shader_file.cpp
Line 95 in 04692d8
And if you notice, that is actually preventing
shader_file->parse_versions_from_text
from being called on line 106: https://github.com/godotengine/godot/blob/04692d83cb8f61002f18ea1d954df8c558ee84f7/editor/import/resource_importer_shader_file.cpp#L106C8-L106C44This is introduces a crash. So we might as well copy that check to the root cause method as well for stability purposes. Which is what I did in my change :)
NOTE:
The change I said I was "confident in" will no longer be necessary when this issue gets resolved: #94734
Which also happens to be an issue I opened 😎. But until then, this change is necessary to prevent crashes and increase stability.
I look forward to hearing your guys thoughts! As always, thanks for the awesome engine! :)