Repository navigation
Use max() to bring negative floats up to 0.0 before uint conversion. - #19255
Merged
AniLeo merged 2 commits intoAug 17, 2026
Merged
Conversation
Author
|
fixes #19254 |
Member
|
Should fix #19001, needs testing |
kd-11
approved these changes
Aug 17, 2026
kd-11
left a comment
Contributor
There was a problem hiding this comment.
I ran some PS3 tests over the weekend and this is in line with what the console does.
Member
|
Probaly fixes #6254, but I don't have AMD card anymore to test with. |
Contributor
|
maybe it fixes also #15571 ? |
Member
|
The bug was exposed by a recent driver update. If the issue is older than 2026, the answer is most likely no. |
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.
Some games show unexpected colors due to conversions with scalar constructors from a float to a uint. The GLSL spec says that these conversions are undefined if the float is negative. These same conversion rules apply for vector constructors (like uvec4).
The solution here is to use max(x, 0.0) to bring the negative float value up to 0.0 before converting to uint.