-
Notifications
You must be signed in to change notification settings - Fork 546
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
[mtl] minimize creation of render passes #2178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍 it would be good to try with the CTS too
@@ -774,7 +774,11 @@ impl CommandSink { | |||
CommandSink::Deferred { ref mut passes, ref mut is_encoding } => { | |||
*is_encoding = keep_open; | |||
passes.push(soft::Pass::Render { | |||
desc: descriptor.to_owned(), | |||
//Note: the original descriptor belongs to the framebuffer, | |||
// and will me mutated afterwards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: me -> be
//Note: the original descriptor belongs to the framebuffer, | ||
// and will me mutated afterwards. | ||
desc: unsafe { | ||
msg_send![descriptor, copy] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we somehow specify whether the copy
is actually needed to avoid this when it hasn't changed?
The copy is needed there anyway in most cases: for copies and blits we know the descriptor is different, otherwise we wouldn't have multiple passes. For real render passes the framebuffer still needs to own one to mutate later, so retaining a strong reference here is not an option.
… On Jun 24, 2018, at 23:12, Josh Groves ***@***.***> wrote:
@grovesNL approved this pull request.
Looks good to me 👍 it would be good to try with the CTS too
In src/backend/metal/src/command.rs:
> @@ -774,7 +774,11 @@ impl CommandSink {
CommandSink::Deferred { ref mut passes, ref mut is_encoding } => {
*is_encoding = keep_open;
passes.push(soft::Pass::Render {
- desc: descriptor.to_owned(),
+ //Note: the original descriptor belongs to the framebuffer,
+ // and will me mutated afterwards.
nit: me -> be
In src/backend/metal/src/command.rs:
> @@ -774,7 +774,11 @@ impl CommandSink {
CommandSink::Deferred { ref mut passes, ref mut is_encoding } => {
*is_encoding = keep_open;
passes.push(soft::Pass::Render {
- desc: descriptor.to_owned(),
+ //Note: the original descriptor belongs to the framebuffer,
+ // and will me mutated afterwards.
+ desc: unsafe {
+ msg_send![descriptor, copy]
Could we somehow specify whether the copy is actually needed to avoid this when it hasn't changed?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
bors r=grovesNL |
2178: [mtl] minimize creation of render passes r=grovesNL a=kvark PR checklist: - [x] `make` succeeds (on *nix) - [x] `make reftests` succeeds - [ ] tested examples with the following backends: The logic is changed in the following way: - a framebuffer still keeps a hold of a render pass descriptor, but now behind a mutex - starting a render pass mutates that locked descriptor in place - if a command buffer is deferred, only then we copy the whole descriptor out - careful treatment of image blits/clears is done to re-use the RP descriptor more often Note: doesn't seem to affect Dota framerate considerably Co-authored-by: Dzmitry Malyshau <[email protected]>
PR checklist:
make
succeeds (on *nix)make reftests
succeedsThe logic is changed in the following way:
Note: doesn't seem to affect Dota framerate considerably