mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
[wgpu-core] remove Arc
around StagingBuffer
This commit is contained in:
parent
b14fe14e88
commit
2ea314e978
@ -334,8 +334,6 @@ pub enum QueueWriteError {
|
||||
DestroyedResource(#[from] DestroyedResourceError),
|
||||
#[error(transparent)]
|
||||
InvalidResource(#[from] InvalidResourceError),
|
||||
#[error("StagingBufferId {0:?} is invalid")]
|
||||
InvalidStagingBufferId(id::StagingBufferId),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Error)]
|
||||
@ -442,7 +440,7 @@ impl Global {
|
||||
let ptr = unsafe { staging_buffer.ptr() };
|
||||
|
||||
let fid = hub.staging_buffers.prepare(queue_id.backend(), id_in);
|
||||
let id = fid.assign(Arc::new(staging_buffer));
|
||||
let id = fid.assign(staging_buffer);
|
||||
resource_log!("Queue::create_staging_buffer {id:?}");
|
||||
|
||||
Ok((id, ptr))
|
||||
@ -462,11 +460,7 @@ impl Global {
|
||||
|
||||
let device = &queue.device;
|
||||
|
||||
let staging_buffer = hub
|
||||
.staging_buffers
|
||||
.unregister(staging_buffer_id)
|
||||
.and_then(Arc::into_inner)
|
||||
.ok_or_else(|| QueueWriteError::InvalidStagingBufferId(staging_buffer_id))?;
|
||||
let staging_buffer = hub.staging_buffers.strict_unregister(staging_buffer_id);
|
||||
|
||||
let mut pending_writes = device.pending_writes.lock();
|
||||
|
||||
|
@ -176,7 +176,7 @@ pub struct Hub {
|
||||
pub(crate) pipeline_caches: Registry<Arc<PipelineCache>>,
|
||||
pub(crate) query_sets: Registry<Fallible<QuerySet>>,
|
||||
pub(crate) buffers: Registry<Fallible<Buffer>>,
|
||||
pub(crate) staging_buffers: Registry<Arc<StagingBuffer>>,
|
||||
pub(crate) staging_buffers: Registry<StagingBuffer>,
|
||||
pub(crate) textures: Registry<Fallible<Texture>>,
|
||||
pub(crate) texture_views: Registry<Fallible<TextureView>>,
|
||||
pub(crate) samplers: Registry<Fallible<Sampler>>,
|
||||
|
Loading…
Reference in New Issue
Block a user