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

Avoid encoding redundant Metal render/compute commands to reduce CPU time #499

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

frenzibyte
Copy link
Contributor

Xcode has been yelling about this for a while now but I haven't realised how bad the overhead is until I've profiled it myself. This PR reduces down all encoding commands as much as possible to save CPU time.

Before After

(late texture creation warning is irrelevant)

The old implementation didn't take into account `SetScissorRect` being called once with a different value then back to a value that's already set in the encoder.
@frenzibyte
Copy link
Contributor Author

Also updated setScissorRects accordingly, reducing CPU overhead.

Before:

CleanShot 2023-04-15 at 13 37 51

After:

CleanShot 2023-04-15 at 13 38 00

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