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

Cache MTLBuffer contents pointer to avoid API call overhead #502

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frenzibyte
Copy link
Contributor

@frenzibyte frenzibyte commented Apr 15, 2023

This becomes very apparent when updating buffers without using blit commands, where 99% of the overhead comes from retrieving the pointer using MTLBuffer.contents().

Before:

CleanShot 2023-04-15 at 12 50 52

(notice MTLBuffer.contents() being the number one hotspot in a 15s record of a game)

After:

CleanShot 2023-04-15 at 12 51 02

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.

None yet

1 participant