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

Vulkan: Batch vertex buffer updates #4843

Merged
merged 3 commits into from May 8, 2023

Conversation

riperiperi
Copy link
Member

@riperiperi riperiperi commented May 7, 2023

This PR batches together vertex buffer updates to reduce the number of individual calls to update vertex buffers. It also avoids rebinding vertex buffers that have not changed, which is common when games are doing instanced rendering.

image

Improves performance slightly on BOTW on my system. Some areas bind more vertex buffers per draw than others.

Note that any improvement greatly depends on the game and the driver.

Some games can bind a large number of vertex buffers for draws. This PR allows for vertex buffers to be updated with one call rather than one per buffer.

This mostly affects the AMD Mesa driver, the testing platform was Steam Deck with Super Mario Odyssey. It was taking about 12% before, should be greatly reduced now.

A small optimization has been added to avoid looking up the same buffer multiple times, as a common pattern is for the same buffer to be bound many times in a row with different ranges.
@riperiperi riperiperi changed the title Vulkan: Perf/vertex buffer batch Vulkan: Batch vertex buffer updates May 7, 2023
@riperiperi riperiperi added gpu Related to Ryujinx.Graphics performance Performance issue or improvement labels May 7, 2023
Copy link
Member

@gdkchan gdkchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@marysaka marysaka merged commit 895d9b5 into Ryujinx:master May 8, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gpu Related to Ryujinx.Graphics performance Performance issue or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants