mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-24 16:31:11 +01:00
Free associated staging buffers
This commit is contained in:
1 parent
e9232127f0
commit
d095dd39b7
1 file changed
+10
@@ -499,6 +499,16 @@ impl<B: GfxBackend> LifetimeTracker<B> {
|
||||
|
||||
if let Some(res) = hub.buffers.unregister_locked(id.0, &mut *guard) {
|
||||
let submit_index = res.life_guard.submission_index.load(Ordering::Acquire);
|
||||
if let resource::BufferMapState::Init {
|
||||
stage_buffer,
|
||||
stage_memory,
|
||||
..
|
||||
} = res.map_state
|
||||
{
|
||||
self.free_resources
|
||||
.buffers
|
||||
.push((stage_buffer, stage_memory));
|
||||
}
|
||||
self.active
|
||||
.iter_mut()
|
||||
.find(|a| a.index == submit_index)
|
||||
|
||||
Reference in new issue
Block a user