mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Don't put the mapped-at-creation staging buffer in the registry
This commit is contained in:
committed by
Erich Gubler
parent
c77b4d3f56
commit
ed852c4774
@@ -217,7 +217,7 @@ impl Global {
|
||||
mapped_at_creation: false,
|
||||
};
|
||||
let stage = match device.create_buffer(&stage_desc, true) {
|
||||
Ok(stage) => stage,
|
||||
Ok(stage) => Arc::new(stage),
|
||||
Err(e) => {
|
||||
to_destroy.push(buffer);
|
||||
break e;
|
||||
@@ -230,14 +230,10 @@ impl Global {
|
||||
Ok(mapping) => mapping,
|
||||
Err(e) => {
|
||||
to_destroy.push(buffer);
|
||||
to_destroy.push(stage);
|
||||
break CreateBufferError::Device(e.into());
|
||||
}
|
||||
};
|
||||
|
||||
let stage_fid = hub.buffers.request();
|
||||
let stage = stage_fid.init(stage);
|
||||
|
||||
assert_eq!(buffer.size % wgt::COPY_BUFFER_ALIGNMENT, 0);
|
||||
// Zero initialize memory and then mark both staging and buffer as initialized
|
||||
// (it's guaranteed that this is the case by the time the buffer is usable)
|
||||
|
||||
Reference in New Issue
Block a user