mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 23:41:01 +01:00
Remove ContextCore from CoreBlas
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
0b6ec579da
commit
275d0d171b
2 files changed
+11
-25
No files matched your search
@@ -234,7 +234,7 @@ impl Blas {
|
||||
&mut self,
|
||||
) -> Option<impl Deref<Target = A::AccelerationStructure> + WasmNotSendSync> {
|
||||
let blas = self.inner.as_core_opt()?;
|
||||
unsafe { blas.context.blas_as_hal::<A>(blas) }
|
||||
unsafe { blas.as_hal::<A>() }
|
||||
}
|
||||
|
||||
#[cfg(custom)]
|
||||
|
||||
@@ -189,13 +189,6 @@ impl ContextWgpuCore {
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn blas_as_hal<A: hal::Api>(
|
||||
&self,
|
||||
blas: &CoreBlas,
|
||||
) -> Option<impl Deref<Target = A::AccelerationStructure>> {
|
||||
unsafe { blas.wgpu_blas.clone().as_hal::<A>() }
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
#[cold]
|
||||
fn handle_error_fatal(
|
||||
@@ -479,10 +472,17 @@ impl fmt::Debug for CoreCommandEncoder {
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct CoreBlas {
|
||||
pub(crate) context: ContextWgpuCore,
|
||||
pub(crate) wgpu_blas: Arc<wgc::resource::Blas>,
|
||||
}
|
||||
|
||||
impl CoreBlas {
|
||||
pub unsafe fn as_hal<A: hal::Api>(
|
||||
&self,
|
||||
) -> Option<impl Deref<Target = A::AccelerationStructure>> {
|
||||
unsafe { self.wgpu_blas.clone().as_hal::<A>() }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct CoreTlas {
|
||||
pub(crate) wgpu_tlas: Arc<wgc::resource::Tlas>,
|
||||
@@ -1414,14 +1414,7 @@ impl dispatch::DeviceInterface for CoreDevice {
|
||||
self.wgpu_device
|
||||
.handle_error(cause, desc.label, "Device::create_blas");
|
||||
}
|
||||
(
|
||||
wgpu_blas.handle(),
|
||||
CoreBlas {
|
||||
context: self.context.clone(),
|
||||
wgpu_blas,
|
||||
}
|
||||
.into(),
|
||||
)
|
||||
(wgpu_blas.handle(), CoreBlas { wgpu_blas }.into())
|
||||
}
|
||||
|
||||
fn create_tlas(&self, desc: &crate::CreateTlasDescriptor<'_>) -> dispatch::DispatchTlas {
|
||||
@@ -1717,14 +1710,7 @@ impl dispatch::QueueInterface for CoreQueue {
|
||||
.device()
|
||||
.handle_error_nolabel(cause, "Queue::compact_blas");
|
||||
}
|
||||
(
|
||||
wgpu_blas.handle(),
|
||||
CoreBlas {
|
||||
context: self.context.clone(),
|
||||
wgpu_blas,
|
||||
}
|
||||
.into(),
|
||||
)
|
||||
(wgpu_blas.handle(), CoreBlas { wgpu_blas }.into())
|
||||
}
|
||||
|
||||
fn present(&self, detail: &dispatch::DispatchSurfaceOutputDetail) {
|
||||
|
||||
Reference in new issue
Block a user