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

Apply floor() to gl_FragCoord #1169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jarisiru
Copy link
Collaborator

@jarisiru jarisiru commented Dec 7, 2021

This change applies floor() to the uses of gl_FragCoord in order to
eliminate the potential ambiguity of having 0.5 in the source values.
This should improve the stability of the shaders in fuzzing.

This change applies floor() to the uses of gl_FragCoord in order to
eliminate the potential ambiguity of having 0.5 in the source values.
This should improve the stability of the shaders in fuzzing.
Copy link
Collaborator

@paulthomson paulthomson left a comment

Choose a reason for hiding this comment

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

Thanks for doing this. I would like to hear Ally's opinion. Some initial thoughts: maybe we should only do this for stable_ shaders. Also, if there are statements like gl_FragCoord.x < ..., then I think we can (and should) avoid flooring in this case. Also, I wonder if doing - 0.5 instead of floor might trigger different compiler behavior; not sure which is best though. I suppose we could do a mix. I think the use of gl_FragCoord.x in the gfauto texture generation code is possibly the most worrying because the results are stored into an 8 bit value, but of course we can address that in a different PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants