-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
nv2a: Handle NaN values to be similar to HW #1780
base: master
Are you sure you want to change the base?
nv2a: Handle NaN values to be similar to HW #1780
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2ab43f1
to
cc001ce
Compare
After giving it some thought and testing I concluded that HW handles -NaN/+NaN the same. It just defaults to 1.0. I changed the implementation and retest everything again based on this assumption. I got the same results as before, but I was already expecting that. I just wanted to double check. @antangelo can you please retest the build on your PC? Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the .gitignore
additions but they should probably be included in a separate PR.
Yeah, I was thinking about it. I gonna wait for @mborgerson to review this PR and create another PR for it if needed. |
For those following along willing to test and share their results here, you must first be signed into GitHub and can then download the xemu build for your specific system. For example, Windows users can directly use this. You'll also need the pgragh test ISO to run within xemu. After you've loaded the pgraph test ISO within xemu it will auto-run (it may assert/crash which is likely fine) all tests. The results are stored on your Xbox HDD at Alternatively, you can easily manually run the When reporting test results within xemu, be sure to grab a copy of your build and system info via
My xemu test results (internal resolution scale set to 1) which do not match real hardware are as follows: |
That's interesting, I wonder why in your PC is black @Ernegien and for @medievil1 seems to be working fine. Considering you both are on Windows 11 and using nvidia GPUs. |
Moved to draft state because although it may fix issues in some games, I'm not convinced yet that this is ready for merge. I'd like to know specifically, for starters:
|
Based on the tests HW maps -NaN to 0, +NaN to 1. I am not sure GLSL provides any way to distinguish between +NaN and -NaN.
|
I don't know what HW tests are you referring to. My HW tests clearly shows the same result for both values, whether the value is -NaN or +NaN doesn't matter. If what you are saying was true, they wouldn't match in most of the tests.
Xemu uses GLSL 4.0. And yes, there's a way to distinguish between +NaN and -NaN using the |
I'm talking about the pgraph test, running on Xbox hardware.
I don't think this is part of the GLSL spec. Ideally there is a way to get the correct behaviour programming to the spec instead of relying on GPU quirks and vendor specific behaviour. |
I wonder about this in the pgraph tests code EDIT |
@mborgerson I used Evox dashboard debugger on my Xbox to inspect Pro Cast: Sports Fishing Game. The NaN values (0xFFC00000) arise, because the game divides 0 by 0 (using FPU fild and fidiv). The pushbuffer from the game with NV097_SET_LIGHT_AMBIENT_COLOR, NV097_SET_LIGHT_DIFFUSE_COLOR and NV097_SET_LIGHT_SPECULAR_COLOR is:
Xemu calculates the same values (according to gdb.) |
This PR is based on @abaire work at #913. So big thanks to him for his research 🙏
Due to his implementation not working on my PC, I decided to do my own research and hopefully came up with a solution that works on any hardware. The solution was tested on 2 PCs: one with an AMD Radeon RX 6600M GPU, and the other with a NVIDIA GeForce GTX 960 GPU. Both running on Windows 11 23H2, 64 GB RAM with the latest drivers installed as of today.
HW test on the left side - PC test on the right side
Otogi: Myth of Demons
Otogi 2: Immortal Warriors
Pro Cast: Sports Fishing Game
Trigger Man
Thousand Land