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: Rework async texture uploads #12389

Merged
merged 3 commits into from
Jul 25, 2022
Merged

vk: Rework async texture uploads #12389

merged 3 commits into from
Jul 25, 2022

Conversation

kd-11
Copy link
Contributor

@kd-11 kd-11 commented Jul 24, 2022

The purpose of flushing the CB for every upload was to improve parallelism, but it triggers a driver bottleneck handling queue submits. There are much better ways to optimize job parallelism if it is indeed required.
Performance now matches the 'fast' mode on AMD and I can see a healthy uptick in performance on NVIDIA hardware as well, accompanies by lower GPU usage (yes, this is a good thing) and lower RSX latency when async streaming is enabled.
If there are any regressions, I have several ideas on how to handle job scheduling to avoid building long dependent chains. Ideally this shouldn't matter too much as a long tail on the leading submit actually improves parallelism with the next leading sequence.
Tested on AMD 22.5.1 and NVIDIA 512.15.

Fixes #11707

@kd-11
Copy link
Contributor Author

kd-11 commented Jul 24, 2022

This reintroduces some bugs already fixed. #9968
Needs some more tuning.

@Asinin3
Copy link
Contributor

Asinin3 commented Jul 24, 2022

Fixes performance issue with Async in Killzone 3. Performance is better as well
Master Async On: 22FPS
Master Async Off: 44FPS
PR Async On: 48FPS

However introduces visual issue with cutscenes and ingame
https://user-images.githubusercontent.com/15137035/180646436-be6371d5-97f4-4012-9f0b-c80c5db60b1d.mp4
async_PSB57jU8jp

@kd-11 kd-11 changed the title vk: Don't send work to the GPU after every async upload vk: Rework async texture uploads Jul 24, 2022
- Use CONCURRENT queue access instead of fighting with queue acquire/release via submit chains.
  The minor benefits of forcing EXCLUSIVE mode are buried under the huge penalty of multiple vkQueueSubmit.
  Batching submits does not help alleviate this situation. We simply must avoid interrupting execution.
- Fix up flush sequence in DMA handling (WCB)
- Do not request resource sharing if queue family is not different!
@kd-11
Copy link
Contributor Author

kd-11 commented Jul 24, 2022

Reimplemented to just use concurrent access. This usually disables some optimizations like DCC but it works just fine. There is a small penalty but nothing compared to the submit hell that was there before.

@kd-11 kd-11 marked this pull request as ready for review July 24, 2022 17:46
@Asinin3
Copy link
Contributor

Asinin3 commented Jul 24, 2022

Graphics fixed in latest commit, but performance seems to have gone down a bit.
Now 45-46FPS

@kd-11
Copy link
Contributor Author

kd-11 commented Jul 24, 2022

Hmm. I thought maybe it was just pascal but it seems all nvidia cards have this impact. I'll try to tune it a bit more, but it's fine if it performs as well as async off. Anything as long as performance is not worse.

@ghost
Copy link

ghost commented Sep 25, 2022

@kd-11 Someone is claiming this PR broke Code Veronica X for them.

i.e. last working build 0.0.23-13964

This is their log, including a fatal rsx::thread related crash. They had some bad settings but claimed it still happened even after fixing them. it seems potentially legit.
RPCS3.log.zip

@kd-11
Copy link
Contributor Author

kd-11 commented Sep 25, 2022

This is their log, including a fatal rsx::thread related crash. They had some bad settings but claimed it still happened even after fixing them. it seems potentially legit.

That game works fine for me on both AMD and NVIDIA using latest master, so I cannot reproduce the error to fix it. I'll need more information including steps required to make it break including savegames and/or screen recordings showing steps needed to recreate the crash.
Just create a ticket with all the info and I can look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Optimization Optimizes existing code Render: Vulkan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Killzone 3) Asynchronous Texture Streaming heavily impacting performance
2 participants