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

VideoBackends:Vulkan: Improve backend multithreading #10977

Merged
merged 1 commit into from Oct 25, 2022

Conversation

TellowKrinkle
Copy link
Contributor

Makes the multiple threads actually able to run at the same time

Fixes https://bugs.dolphin-emu.org/issues/12961

@AdmiralCurtiss
Copy link
Contributor

Can someone review this?

@dvessel
Copy link
Contributor

dvessel commented Sep 9, 2022

I never posted it but I did a quick test shortly after the PR was pushed and there was a slight improvement (this might be due to running a custom build with tello’s other PR’s) but it no longer makes a difference when toggling backend multithreading. There is a slight regression overall.

F-Zero - Sand Ocean intro 1x native

BEFORE (lastest master):

Multithreading enabled
1/1 vulkan..........................8.488ms

Multithreading disabled
1/1 vulkan.........................8.322ms

AFTER (merged with master):

Multithreading enabled
1/1 vulkan...........................8.812ms

Multithreading disabled
1/1 vulkan..........................8.670ms

Zelda - Wind Waker Intro 4x native

BEFORE (lastest master):

Multithreading enabled
1/1 vulkan.......10.042ms

Multithreading disabled
1/1 vulkan.......10.038ms

AFTER (merged with master):

Multithreading enabled
1/1 vulkan.......10.300ms

Multithreading disabled
1/1 vulkan........10.356ms

@TellowKrinkle
Copy link
Contributor Author

Thinking about this more, we're waiting on the last submitted command buffer before submitting the next, which will hurt when GPU-bound.

We need to either fix this in a different way or increase the number of command buffers to 3

Will close this while I decide what to do about it

@TellowKrinkle
Copy link
Contributor Author

TellowKrinkle commented Oct 10, 2022

Looks like all I had to do was wait
With #11090 merged, this is no longer an issue

Note: Skyward Sword was broken by #11090 on MoltenVK, fixed by #11122. Might want to hold out on testing this until it's merged. #11122 was merged

Seeing an improvement from ~58fps to ~64fps on Skyward Sword SC with #11122 and #10979 pre-applied, compared to Metal's ~66fps on an AMD Radeon Pro 5600M. On Intel graphics, which has a relatively slow Metal driver, MVK is now slightly faster than Metal at 58fps vs 55fps.

@TellowKrinkle
Copy link
Contributor Author

Updated with a new, less hacky implementation
Also pictures
Before (thread timeline of one frame of the Skyward Sword file select screen on SC):
image
After (time scales are approximately equal at ~18.5ms for the whole view):
image

Makes the multiple threads actually able to run at the same time
@JMC47 JMC47 merged commit 027e104 into dolphin-emu:master Oct 25, 2022
11 checks passed
@TellowKrinkle TellowKrinkle deleted the FixBackendMultithreading branch October 25, 2022 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants