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

GS: Pre-round/truncate STQ values based on hardware tests #10281

Merged
merged 2 commits into from
Nov 25, 2023

Conversation

refractionpcsx2
Copy link
Member

@refractionpcsx2 refractionpcsx2 commented Nov 16, 2023

Description of Changes

Pre-rounds and truncates STQ float values for textures on sprites.

Rationale behind Changes

Extracted as safe code to use from #6553 so we can at least get the manhunt fixes in for the lighting.
We did some tests on hardware, and we found the truncating of float values gets pretty crazy depending on the difference between values. What is done in this PR seems to work pretty well for a bunch of games, however hardware mode won't feel all the fixes, I believe due to the difference in how GPU's handle texture coordinates.

Suggested Testing Steps

Test any games including the ones listed below, make sure nothing looks busted in software and hardware.

All the following results are on Software mode

Ben 10:
Master:
image
PR:
image

Armored Core 2:
Master:
image
PR:
image

Beyond Good & Evil:
Master:
image
PR:
image

G-Force: (kind of subjective but certainly not bad, matches some other lines on the scene)
Master:
image
PR:
image

Manhunt:
Master:
image
PR:
image

Shinobido - Way of the Ninja (this isn't right either, tbh, but neither is master, and the PS2 is janky as well)
Master:
image
PR:
image
PS2 for reference:
image

Persona 3:
Master:
image
PR:
image

Persona 3 again:
Master:
image
PR:
image

pcsx2/GS/GSState.cpp Outdated Show resolved Hide resolved
@stenzek
Copy link
Contributor

stenzek commented Nov 17, 2023

Probably should do some performance testing, this per-vertex loop looks quite heavy. Vectorizing it could be.. tricky.

@refractionpcsx2 refractionpcsx2 force-pushed the gs_preroundstq branch 2 times, most recently from 863cb3a to 3593e15 Compare November 17, 2023 10:23
@refractionpcsx2
Copy link
Member Author

For the moment I've limited this to sprites and flat draws only to try and avoid performance problems.

We do plan to move this to the vertex shaders + Software JIT directly where we should be able to do it with more performance, at that point the ghost rider shadow will work correctly.

@refractionpcsx2 refractionpcsx2 force-pushed the gs_preroundstq branch 2 times, most recently from 9c2c733 to 1f8630d Compare November 17, 2023 11:04
@refractionpcsx2 refractionpcsx2 merged commit 6d31ef8 into master Nov 25, 2023
24 checks passed
@refractionpcsx2 refractionpcsx2 deleted the gs_preroundstq branch November 25, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants