-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
GS: Clamp ST coordinates to valid range in GS vertex trace. #12201
base: master
Are you sure you want to change the base?
Conversation
28bd2ef
to
9a9d41c
Compare
TODO: On the dumps that I saw a difference should be checked on a ps2 to compare how they should look like. |
Lightning, would you be able to provide the dump name (if it is in gspack-10-july-2024)? I will try to work on this further given the new info from the hardware tests Ziemas ran. |
007 Agent Under Fire - door blend There's more but the list is huge, ace combat 4, ape escape 2 dave mirra seem broken. |
Thanks much, this should keep me busy for some time |
9f59b3f
to
310b642
Compare
310b642
to
34c4629
Compare
239c4d4
to
8f552cf
Compare
8f552cf
to
1f974c9
Compare
I've fixed a few issues and the dump run seems to look good now on my end. |
1f974c9
to
25ee06b
Compare
Description of Changes
In the vertex trace, clamp floating point UV coordinates to valid UV ranges [-2047, 2047].
Rationale behind Changes
In the vertex trace, input float texture coordinates can sometimes be buggy (for reasons not totally clear, it might be emulation or game bugs), so they might be outside the valid ranges that the GS can process. Casting such values to integer can causes issues down stream with functions that use the vertex trace min/max texture coordinates, so this should fix some of those issues. In all the example I found, the issue was with SW renderer not loading a full texture (because it depends on vertex trace calulations) and thus sampling from garbage values.
Suggested Testing Steps
Testing on GS dumps/games that are known to have buggy/huge texture coordinates as described above. I didn't find anything that was obviously broken in testing, though any help testing on more games/dumps or feedback on the changes would be greatly appreciated.
Here are the most visible fixes that I could find in testing (before is left and after is right)
Should be a slight blurring effect (Counter_Terrorist_Special_Forces_-_Fire_for_Effect_SLES-53046_20230830195729.gs.xz).
Should not have double eyebrows (Bakugan_Battle_Brawlers_shadows.gs.xz).
Should have a faint star-like patterns (Psychonauts_SLUS-21120_20231013005852.gs.xz).
Should have character's shadow (Tomb_Raider_-_Legend_SLUS-21203_20230905130255.gs.xz).
Should not have dark road (testdriveswminmax.gs.xz).