-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[wgpu] add convience functions for deferring mapping/callbacks #8125
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
base: trunk
Are you sure you want to change the base?
Conversation
e910b48
to
e42ba38
Compare
Co-authored-by: Kevin Reid <[email protected]>
63ad459
to
d43a9bf
Compare
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.
neat!
I think it's rather unfortunate to have this kind of extension in wgpu proper rather than an extension to it. Makes me wonder whether those deferred commands could be more generic and then we expose the concrete buffer extension as a utility.... but I don't want to throw a wrench into a perfectly good feature that is really hard to get into the ecosystem if we don't put it in here. So overall slight scope creep concerns, but let's ship this anyways!
|
||
/// A deferred buffer mapping request captured during encoding (or a pass) | ||
/// and executed later when the command buffer is submitted. | ||
pub(crate) struct BufferMapping { |
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.
let's call it DeferredBufferMapping
to make clear to anyone stumbling over this type that regular buffer mapping operations don't go through this
Connections
None
Description
This adds various functions for making dealing with mapping and other callbacks easier. Often you are working with a command buffer then want to map a buffer or do something when that command buffer is submitted. Normally you need to build some kind of infrastructure for this (I have many times) but this can be really easily be done by wgpu itself for very little cost.
Testing
Told GPT-5 to put together some tests as an experiment. I think it did okay.
Squash or Rebase?
Rebase me pls
Checklist