-
Notifications
You must be signed in to change notification settings - Fork 1k
RenderBundle support #286
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
RenderBundle support #286
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.
I'm not knowledgeable on the content, but nothing stuck out to me in the code itself.
Faced a conceptual problem with life times here. lifetime problemA render bundle knows about its dependencies and carries a However, the problem comes from actual details. When the bundle is executed in a pass, we just merge in the stream of commands from the bundle. Suppose this stream uses resource A, held alive by the bundle. Suppose the resource got dropped by the user before using the bundle. When the render pass finishes, it goes through the raw commands and encounters that resources, and it sees that the resource is dead. So it panics, since from its perspective, the dependency wasn't held alive. Proposed solutionI think we can get away here by carrying the Second part is to avoid the tracker panic in this borrow. Instead, a resource should produce |
@cwfitzgerald sorry about the size here, I had to take a different approach in light of the lifetime issues expressed in the previous comments. I believe, it's all for the better, as bundles are now truly visible in the API tracing, and faster to work with. Please see the description at the top of "bundle.rs" in this PR. |
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.
A couple comments/concerns, but nothing major :)
This is a major change in how the bundles are implemented. Instead of transparently injecting them into the pass command stream, we are now treating bundles as first-class API objects and API tracing them accordingly. The bundle contains a normalized command stream that is very easy to inject into a native command buffer multiple times.
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.
Thank you!
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.
LGTM
bors r=cwfitzgerald |
37: Update wgpu with bundle support r=kvark a=kvark Depends on gfx-rs/wgpu#286 Blocked on mozilla/cbindgen#532 :( Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
37: Update wgpu with bundle support r=kvark a=kvark Depends on gfx-rs/wgpu#286 Blocked on mozilla/cbindgen#532 :( Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Implements the API of gpuweb/gpuweb#301
The general concept here is having re-usable command streams, which seems much desired given that our command buffers are not reusable.
Currently, only "software" render bundles are supported. That means, they are just smaller chunks of render pass commands, not backed by any driver object.
TODO: