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

Fix default SDFGI variant not being compiled in time. #102122

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

DarioSamo
Copy link
Contributor

Fixes #101826.

There was a possible race condition between the SDFGI variant for the material being compiled in time and this uniform setup function using it. Technically, retrieving the shader variant before the group is enabled is not valid behavior under the new design. Getting the shader variant after the group is enabled guarantees there won't be a race condition, but getting the variant before that only returns a placeholder but the shader isn't guaranteed to be filled out.

Pretty much no other code does something like this so the issue was very isolated to this particular case, so the fix is just to defer the retrieval of the variant until it's actually necessary and ensure the shader group is initialized before doing so.

Copy link
Member

@clayjohn clayjohn 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!

@Repiteo Repiteo merged commit 4b9f882 into godotengine:master Jan 29, 2025
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 29, 2025

Thanks!

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.

[4.4beta1] Enabling SDFGI -> Desired set (1) not used by shader
4 participants