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

vk: Promote barycentric interpolation to 64-bit #13690

Merged
merged 2 commits into from
Apr 18, 2023
Merged

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Apr 18, 2023

Not exactly a performant solution especially with big shaders with tons of interpolation but it shouldn't be too much of a problem on modern hw.

Fixes #13686
Fixes #13682

@solarmystic
Copy link

solarmystic commented Apr 18, 2023

Was curious to see if there's any noticeable performance hit/increase in GPU usage on a 2080TI, did the usual 5 game bench compared to latest master and in certain games the performance hit is absolutely insane (DeS in particular).

Demon's Souls - Master is over 3x faster than PR, and GPU usage skyrockets to 92%
Master (14879) - 101/84/64 FPS - GPU Usage 48%
This PR - 33/32/31 FPS - GPU Usage 92%

Persona 5 - Performance is nearly halved and GPU usage is completely maxed out in PR build.
Master (14879) - 92/63/56 FPS - GPU Usage 56%
This PR - 50/19/17 FPS - GPU Usage 99%

GOW3 - Severe performance degradation and close to doubling of GPU usage.
Master (14879) - 123/98/68 FPS - GPU Usage 34%
This PR - 92/70/57 FPS - GPU Usage 61%

GOWA - Average FPS unchanged, however GPU usage nearly doubled
Master (14879) - 61/55/51 FPS - GPU Usage 23%
This PR - 61/56/50 FPS - GPU Usage 42%

TLOU - Minor regression in FPS, but GPU usage rises significantly
Master (14879) - 50/46/43 FPS - GPU Usage 43%
This PR - 47/42/38 FPS - GPU Usage 69%

All screenshots with results taken for this post:-
879 vs baryo.zip

System used for testing - 12700KF stock/2080TI with 527.56 drivers/W10 21H2

@solarmystic
Copy link

solarmystic commented Apr 18, 2023

Okay, so turning Shader Quality to Low mostly resolved the performance hit from this PR in those 5 games tested in my previous post.

If this PR is merged as-is, Shader Quality Low should be the new recommended default for NVIDIA cards since High will incur a crazy penalty to performance even on upper midrange cards like the 2080ti. Currently, Shader Quality is set to High by default in brand new installations of rpcs3.

The few games that need Shader Quality High should be noted, and the recommended setting added to their respective wiki pages.

@kd-11
Copy link
Contributor Author

kd-11 commented Apr 18, 2023

I'll add an ultra setting instead above high. Low has too many performance-centric optimizations to be a recommended default.

@Ordinary205
Copy link
Contributor

Ordinary205 commented Apr 18, 2023

This PR build somehow removes almost entire vertex explosions on Need for Speed: Rivals.

@kd-11 kd-11 merged commit 9ff6003 into RPCS3:master Apr 18, 2023
@kd-11 kd-11 deleted the nvidia-pains branch April 18, 2023 13:25
@Linear524
Copy link

RSX accuracy is more important than extra high fps right now. Many games needs only 30 fps, but all of them need correctly rendered graphics...
Thanks you KD-11 ! :)
Waiting for your #10208 progress and #9133 fixes :)

@Augusto7743
Copy link

@kd-11
"I'll add an ultra setting instead above high"
Correct.

About the shader quality choice between low and high the user will select high waiting see better graphics.
I have an low old video card GT 640 and testing in rpcs3-v0.0.27-14821-0beda6fa_linux64 selecting low or high is the same gpu usage.
One thing or other ... low and high not does much more gpu usage or the video card is so slow the shader quality high is being processed slow.
With the GT 640 is possible use resolution scale above 175 % being enough to better internal render quality. Graphics are so good look similar with some PS4 games and "fixes" the problem in several PS3 games using upscaling graphics doing bluring terrible effetcs =)

Shader "low" will output exactly the same graphics as are in PS3 ?

Thanks for doing RPCS3 better in each new release )
Have an nice week.

@Triang3l
Copy link
Contributor

Is the original issue that the game outputs the same values for all three vertices, and expects the pixel shader input to be exactly the same, or is that overall a precision issue? Since the RSX was made by Nvidia, considering how interpolation works on their modern GPUs, I'm not sure if games could reliably assume that for three same outputs, the input will be the same. However, if that's actually the issue, you can try changing the interpolation formula from i * v0 + j * v1 + k * v2 to v0 + j * (v1 - v0) + k * (v2 - v0) (how AMD interpolates pixel shader inputs), so that the exact value for one of the vertices will be the result, and the interpolation will be cancelled out completely by the differences between vertex values being zero: xenia-project/xenia#2012

@kd-11
Copy link
Contributor Author

kd-11 commented Apr 20, 2023

Is the original issue that the game outputs the same values for all three vertices, and expects the pixel shader input to be exactly the same, or is that overall a precision issue? Since the RSX was made by Nvidia, considering how interpolation works on their modern GPUs, I'm not sure if games could reliably assume that for three same outputs, the input will be the same. However, if that's actually the issue, you can try changing the interpolation formula from i * v0 + j * v1 + k * v2 to v0 + j * (v1 - v0) + k * (v2 - v0) (how AMD interpolates pixel shader inputs), so that the exact value for one of the vertices will be the result, and the interpolation will be cancelled out completely by the differences between vertex values being zero: xenia-project/xenia#2012

RSX interpolation works differently than modern NVIDIA GPUs. Games absolutely rely on the interpolated attributes to be an exact match. I'll give the alternative interpolation a shot.

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.

NARUTO Shippuden: Ultimate Ninja STORM 2 Graphical issue [Regression] Destiny text is incorrectly rendered
7 participants