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

Use non-retaining command buffers on Metal #1779

Closed
kvark opened this issue Jan 30, 2018 · 0 comments
Closed

Use non-retaining command buffers on Metal #1779

kvark opened this issue Jan 30, 2018 · 0 comments

Comments

@kvark
Copy link
Member

kvark commented Jan 30, 2018

From https://developer.apple.com/documentation/metal/mtlcommandqueue/1508684-makecommandbufferwithunretainedr :

Use this method only in extremely performance-critical applications where the cost of maintaining references to objects is significant, and references by some other part of the application can be guaranteed until the object is no longer needed for command execution.

So one important point is Apple did go this extra step to provide a method, meaning that the performance difference is expected. Since we are manually tracking the lifetimes on other backends, we should be using this code paths on Metal, minus some cases where we currently rely on tracking:

bors bot added a commit that referenced this issue Apr 16, 2018
1936: [mtl] manually retain command buffer data r=grovesNL a=kvark

Fixes #1779
PR checklist:
- [x] `make` succeeds (on *nix)
- [x] `make reftests` succeeds
- [x] tested examples with the following backends: Metal

r? @JohnColanduoni @grovesNL 
As mentioned on gitter, this doesn't allow us to get rid of the autorelease pools unfortunately. We can see it as a different issue.

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
@bors bors bot closed this as completed in #1936 Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant