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

[mtl] minimize creation of render passes #2178

Merged
merged 1 commit into from
Jun 25, 2018
Merged

Conversation

kvark
Copy link
Member

@kvark kvark commented Jun 25, 2018

PR checklist:

  • make succeeds (on *nix)
  • 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

@kvark kvark requested a review from grovesNL June 25, 2018 02:33
@kvark kvark mentioned this pull request Jun 25, 2018
22 tasks
Copy link
Contributor

@grovesNL grovesNL left a 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.
Copy link
Contributor

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]
Copy link
Contributor

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?

@kvark
Copy link
Member Author

kvark commented Jun 25, 2018 via email

@kvark
Copy link
Member Author

kvark commented Jun 25, 2018

bors r=grovesNL

bors bot added a commit that referenced this pull request Jun 25, 2018
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]>
@bors
Copy link
Contributor

bors bot commented Jun 25, 2018

@bors bors bot merged commit 7ee40d4 into gfx-rs:master Jun 25, 2018
@kvark kvark deleted the mtl-render-pass branch June 25, 2018 13:22
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.

2 participants