[core-remote] remove StagingBuffer stuff from global

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev authored and Teodor Tanasoaia committed 2026-08-14 16:30:02 +02:00
1 parent ceb0582857
commit 2e14c1c28d
3 files changed
+2 -37

No files matched your search

+1 -31
View File
@@ -1,10 +1,8 @@
use core::ptr::NonNull;
use wgpu_core::device::queue::{QueueSubmitError, QueueWriteError, SubmittedWorkDoneClosure};
use wgpu_core::SubmissionIndex;
use crate::global::Global;
use crate::id::{BufferId, CommandBufferId, QueueId, StagingBufferId, TextureId};
use crate::id::{BufferId, CommandBufferId, QueueId, TextureId};
impl Global {
pub fn queue_write_buffer(
@@ -20,34 +18,6 @@ impl Global {
queue.write_buffer(buffer, buffer_offset, data)
}
pub fn queue_create_staging_buffer(
&self,
queue_id: QueueId,
buffer_size: wgt::BufferSize,
id_in: Option<StagingBufferId>,
) -> Result<(StagingBufferId, NonNull<u8>), QueueWriteError> {
let queue = self.hub.queues.get(queue_id);
let (staging_buffer, ptr) = queue.create_staging_buffer(buffer_size)?;
let fid = self.hub.staging_buffers.prepare(id_in);
let id = fid.assign(staging_buffer);
Ok((id, ptr))
}
pub fn queue_write_staging_buffer(
&self,
queue_id: QueueId,
buffer_id: BufferId,
buffer_offset: wgt::BufferAddress,
staging_buffer_id: StagingBufferId,
) -> Result<(), QueueWriteError> {
let queue = self.hub.queues.get(queue_id);
let buffer = self.hub.buffers.get(buffer_id);
let staging_buffer = self.hub.staging_buffers.remove(staging_buffer_id);
queue.write_staging_buffer(buffer, buffer_offset, staging_buffer)
}
pub fn queue_validate_write_buffer(
&self,
queue_id: QueueId,
+1 -5
View File
@@ -115,9 +115,7 @@ use wgpu_core::{
device::{queue::Queue, Device},
instance::Adapter,
pipeline::{ComputePipeline, PipelineCache, RenderPipeline, ShaderModule},
resource::{
Blas, Buffer, ExternalTexture, QuerySet, Sampler, StagingBuffer, Texture, TextureView, Tlas,
},
resource::{Blas, Buffer, ExternalTexture, QuerySet, Sampler, Texture, TextureView, Tlas},
};
use parking_lot::Mutex;
@@ -191,7 +189,6 @@ pub struct Hub {
pub(crate) pipeline_caches: Registry<Arc<PipelineCache>>,
pub(crate) query_sets: Registry<Arc<QuerySet>>,
pub(crate) buffers: Registry<Arc<Buffer>>,
pub(crate) staging_buffers: Registry<StagingBuffer>,
pub(crate) textures: Registry<Arc<Texture>>,
pub(crate) texture_views: Registry<Arc<TextureView>>,
pub(crate) external_textures: Registry<Arc<ExternalTexture>>,
@@ -228,7 +225,6 @@ impl Hub {
pipeline_caches: Registry::new(),
query_sets: Registry::new(),
buffers: Registry::new(),
staging_buffers: Registry::new(),
textures: Registry::new(),
texture_views: Registry::new(),
external_textures: Registry::new(),
-1
View File
@@ -215,7 +215,6 @@ ids! {
pub type DeviceId Device;
pub type QueueId Queue;
pub type BufferId Buffer;
pub type StagingBufferId StagingBuffer;
pub type TextureViewId TextureView;
pub type TextureId Texture;
pub type ExternalTextureId ExternalTexture;