Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Consume command buffers on submit #267

Closed
kvark opened this issue Apr 21, 2020 · 2 comments · Fixed by #281
Closed

Consume command buffers on submit #267

kvark opened this issue Apr 21, 2020 · 2 comments · Fixed by #281
Assignees
Labels
enhancement New feature or request

Comments

@kvark
Copy link
Member

kvark commented Apr 21, 2020

This would reflect the semantics of the API. You can't re-use them anyway.

@kvark kvark added the help wanted Extra attention is needed label Apr 21, 2020
@shika-blyat
Copy link

shika-blyat commented Apr 26, 2020

The submit functions takes a slice, which allows people to do things like:

            let encoder = encoder.finish();
            let cb = [encoder];
            state.queue.submit(&cb);
            // here encoder remains in the scope

one way to avoid this would be to take a Vec<CommandBuffer> instead of &[CommandBuffer], right ?
The main downside of a such thing would be that it enforces people using a Vec, and would be a breaking change 🤔.
Were you thinking about something else or is this this what you're expecting ?

@kvark kvark self-assigned this Apr 26, 2020
@kvark
Copy link
Member Author

kvark commented Apr 26, 2020

I'm looking into it, will accept IntoIterator<Item = CommandBuffer>

@kvark kvark added enhancement New feature or request and removed help wanted Extra attention is needed labels Apr 26, 2020
@bors bors bot closed this as completed in #281 Apr 27, 2020
@bors bors bot closed this as completed in 49640d2 Apr 27, 2020
kejor pushed a commit to kejor/wgpu-rs that referenced this issue Nov 28, 2020
267: Use extend_from_slice instead of copy_from_slice r=kvark a=kocsis1david

`copy_from_slice` gives an error because it expects the lengths to be the same.

Co-authored-by: David <kocsis1david@windowslive.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants