Explicitly initialize ltcgi_output.color for diffuse and specular#33
Merged
PiMaker merged 1 commit intoPiMaker:mainfrom Jun 7, 2024
Merged
Explicitly initialize ltcgi_output.color for diffuse and specular#33PiMaker merged 1 commit intoPiMaker:mainfrom
PiMaker merged 1 commit intoPiMaker:mainfrom
Conversation
This should mitigate a compiler failure which commonly affects the Mochie Standard shader for some reason.
PiMaker
reviewed
May 12, 2024
Comment on lines
299
to
+300
| ltcgi_output diff; | ||
| diff.color = 0; |
Owner
There was a problem hiding this comment.
Does it work if you do this in both places too? That might be a bit cleaner, even though it's already cursed compiler territory.
Suggested change
| ltcgi_output diff; | |
| diff.color = 0; | |
| ltcgi_output diff = (ltcgi_output)0; |
Contributor
Author
There was a problem hiding this comment.
I am not sure if that resolves it due to when I add the fix and successfully compiles it, then try to undo the change, it continues to succeed compiling. So I don't have a project I can test it in currently since I don't know how to consistently repro it.
As long as the compiler things that its fields are initialized at that point it should work, in theory at least. If I run across it again, I'll certainly give that a test to confirm it.
Owner
|
Eh, I'll just merge this as-is if you confirmed this to be working. Thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should mitigate a compiler failure which commonly affects the Mochie Standard shader for some reason.
The repro is difficult and inconsistent, but when it does get triggered, adding these two lines and then reimporting the affected shader (usually mochie standard as mentioned) fixes the issue.