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

Avoid crash when importing .glsl in headless #92539

Merged
merged 1 commit into from
May 30, 2024

Conversation

RandomShaper
Copy link
Member

First, this is a band-aid for a knife stab.

Given that the import process for .glsl files involves querying the currently active rendering driver, via RenderingDevice, for its capabilities, it's not possible to perform such an import in headless mode. A crash due to null pointer happens. And that's what this PR patches: you are warned the import couldn't happen instead of geting a crash.

However, the issue is much deeper. Which rendering driver is curently active shouldn't have an impact on how the shader from the .glsl file is conditioned since at runtime a different one may be enabled. Re-thinking how that works is required. This PR only takes us so far.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense as a stopgap, but indeed this needs to be reworked further.

@akien-mga akien-mga merged commit ff242e2 into godotengine:master May 30, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@RandomShaper RandomShaper deleted the no_crash_glsl_headless branch May 30, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants