Remove ContextCore from CoreQueue

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev authored and Teodor Tanasoaia committed 2026-08-31 11:20:09 +02:00
1 parent ff10d10392
commit 4dee23be42
2 files changed
+11 -18

No files matched your search

+1 -1
View File
@@ -365,7 +365,7 @@ impl Queue {
&self,
) -> Option<impl core::ops::Deref<Target = A::Queue> + WasmNotSendSync> {
let queue = self.inner.as_core_opt()?;
unsafe { queue.context.queue_as_hal::<A>(queue) }
unsafe { queue.as_hal::<A>() }
}
/// Schedule a surface texture to be presented on the owning surface.
+10 -17
View File
@@ -107,10 +107,7 @@ impl ContextWgpuCore {
context: self.clone(),
wgpu_device: device.clone(),
};
let queue = CoreQueue {
context: self.clone(),
wgpu_queue: queue,
};
let queue = CoreQueue { wgpu_queue: queue };
Ok((device, queue))
}
@@ -170,13 +167,6 @@ impl ContextWgpuCore {
) -> Option<impl Deref<Target = A::Device>> {
unsafe { device.wgpu_device.clone().as_hal::<A>() }
}
pub unsafe fn queue_as_hal<A: hal::Api>(
&self,
queue: &CoreQueue,
) -> Option<impl Deref<Target = A::Queue> + WasmNotSendSync> {
unsafe { queue.wgpu_queue.clone().as_hal::<A>() }
}
}
fn map_buffer_copy_view(
@@ -390,19 +380,25 @@ pub struct CoreRenderBundle {
#[derive(Clone)]
pub struct CoreQueue {
pub(crate) context: ContextWgpuCore,
pub(crate) wgpu_queue: Arc<wgc::device::queue::Queue>,
}
impl fmt::Debug for CoreQueue {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("CoreQueue")
.field("context", &self.context)
.field("wgpu_queue", &Arc::as_ptr(&self.wgpu_queue))
.finish()
}
}
impl CoreQueue {
pub unsafe fn as_hal<A: hal::Api>(
&self,
) -> Option<impl Deref<Target = A::Queue> + WasmNotSendSync> {
unsafe { self.wgpu_queue.clone().as_hal::<A>() }
}
}
#[derive(Debug, Clone)]
pub struct CoreComputePipeline {
pub(crate) wgpu_compute_pipeline: Arc<wgc::pipeline::ComputePipeline>,
@@ -737,10 +733,7 @@ impl dispatch::AdapterInterface for CoreAdapter {
context: self.context.clone(),
wgpu_device: device,
};
let queue = CoreQueue {
context: self.context.clone(),
wgpu_queue: queue,
};
let queue = CoreQueue { wgpu_queue: queue };
Box::pin(ready(Ok((device.into(), queue.into()))))
}