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

Add bindgroup cache in wgpu #130

Merged
merged 2 commits into from
Jul 13, 2024

Conversation

Uriopass
Copy link
Contributor

@Uriopass Uriopass commented Dec 20, 2023

avoid recreating them every frame

closes #97

@Uriopass Uriopass requested a review from LPGhatguy as a code owner December 20, 2023 11:38
@LPGhatguy
Copy link
Member

I've been meaning to test this PR properly since it's more involved than the widgets you've PR'd. I'll let you know as soon as I can and I'll have a good review for you!

avoid recreating them every frame
@Uriopass Uriopass force-pushed the wgpu_bindgroup_cache branch from d428807 to 4c7dfc0 Compare February 7, 2024 18:16
@Uriopass
Copy link
Contributor Author

Uriopass commented Feb 7, 2024

Updated to main and clear the cache every frame to avoid dealing with invalidation (shouldn't be that hard though).
Still huge wins: On my (now quite big) yakui scene with a bunch of text and textures tracy says update_buffers goes from 0.5ms to 0.1ms

Yakui's overhead is still 0.8ms (down from 1.2ms)
image

I wonder if the previous frame's paint data could be reused somehow but that's a whole new thing.

There's probably a bit of overhead from tracy/profiling too since every paint call is tracked

@Uriopass
Copy link
Contributor Author

Uriopass commented Feb 7, 2024

Also of interest: 95% of the wins come from the default texture and the glyph cache texture bindgroups.

I tried caching just them for a simpler solution (and easier to review). However the glyph cache is handled in yakui-widgets and therefore is not easily accessible from yakui-wgpu.

@LPGhatguy LPGhatguy merged commit 49c3305 into SecondHalfGames:main Jul 13, 2024
2 checks passed
@Uriopass Uriopass deleted the wgpu_bindgroup_cache branch July 13, 2024 17:48
LPGhatguy added a commit that referenced this pull request Jul 25, 2024
avoid recreating them every frame

Co-authored-by: Lucien Greathouse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deduplicate BindGroups in wgpu renderer
2 participants