Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions wgpu/src/backend/webgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,8 +1215,9 @@ struct WebBufferMapState {
pub struct WebBuffer {
/// The associated GPU buffer.
inner: webgpu_sys::GpuBuffer,
/// The mapped array buffer and mapped range.
mapping: RefCell<WebBufferMapState>,
/// The mapped array buffer and mapped range. Shared across clones, because an unmap through
/// any one clone detaches the `ArrayBuffer` for all of them.
mapping: Rc<RefCell<WebBufferMapState>>,
/// Unique identifier for this Buffer.
ident: crate::cmp::Identifier,
}
Expand All @@ -1226,10 +1227,10 @@ impl WebBuffer {
fn new(inner: webgpu_sys::GpuBuffer, desc: &crate::BufferDescriptor<'_>) -> Self {
Self {
inner,
mapping: RefCell::new(WebBufferMapState {
mapping: Rc::new(RefCell::new(WebBufferMapState {
mapped_buffer: None,
range: 0..desc.size,
}),
})),
ident: crate::cmp::Identifier::create(),
}
}
Expand Down
Loading