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
rsx: Implement Z value snapping to account for precision errors #11766
Conversation
Interesting. The value I picked solves the issue on amd but not nvidia. This will be messy lol. |
I noticed that a lot of things are renders fine on amd but have some precision issues on Nvidia... |
I have amd gpu(rx 470) |
Odd, the issue is fixed on my 6700XT. |
Still the same issue on Sega Rally :/ GPU: Nvidia Quadro P1000 |
Extended the range, check if the new build is better once its ready. |
The best value that worked for me was |
Hmm, it may be possible to automatically calculate the range. I'll try and infer the range from the Z range. |
Reimplemented using an algorithm to calculate the breakpoint where changes in the Z value have no impact on the Z buffer anymore. This actually works out very close to your estimate, the real value works out to around 0.000119209296656. |
It works great on Sega Rally! 👍 |
Lgtm |
#10955 is a similar bug but it happens much earlier in the pipeline. It will need a slightly different fix. |
Snap resulting Z values to integral stops to try and account for precision errors.
The cause of the errors is actually the inversion of w. Large w values will give very small results that have tiny precision loss. The computed NDC Z is then very slightly outside the range we want (e.g 1.0000001 in a Z range of 0.99-1.0)
Fixes #11669
Fixes #11765