From 633081c80e64f0d90bd9eb0c6226443a62637ae1 Mon Sep 17 00:00:00 2001 From: sagudev <16504129+sagudev@users.noreply.github.com> Date: Wed, 26 Aug 2026 19:25:14 +0200 Subject: [PATCH] Remove ContextCore from CoreTlas Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --- wgpu/src/api/tlas.rs | 2 +- wgpu/src/backend/wgpu_core.rs | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/wgpu/src/api/tlas.rs b/wgpu/src/api/tlas.rs index d71918c77..0d9d88b90 100644 --- a/wgpu/src/api/tlas.rs +++ b/wgpu/src/api/tlas.rs @@ -72,7 +72,7 @@ impl Tlas { &mut self, ) -> Option> { let tlas = self.inner.as_core_opt()?; - unsafe { tlas.context.tlas_as_hal::(tlas) } + unsafe { tlas.as_hal::() } } /// Returns custom implementation of Tlas (if custom backend and is internally T) diff --git a/wgpu/src/backend/wgpu_core.rs b/wgpu/src/backend/wgpu_core.rs index 7ce4b67ac..0d48660d3 100644 --- a/wgpu/src/backend/wgpu_core.rs +++ b/wgpu/src/backend/wgpu_core.rs @@ -233,13 +233,6 @@ impl ContextWgpuCore { unsafe { blas.wgpu_blas.clone().as_hal::() } } - pub unsafe fn tlas_as_hal( - &self, - tlas: &CoreTlas, - ) -> Option> { - unsafe { tlas.wgpu_tlas.clone().as_hal::() } - } - #[track_caller] #[cold] fn handle_error_fatal( @@ -505,10 +498,17 @@ pub struct CoreBlas { #[derive(Debug, Clone)] pub struct CoreTlas { - pub(crate) context: ContextWgpuCore, pub(crate) wgpu_tlas: Arc, } +impl CoreTlas { + pub unsafe fn as_hal( + &self, + ) -> Option> { + unsafe { self.wgpu_tlas.clone().as_hal::() } + } +} + #[derive(Clone)] pub struct CoreSurfaceOutputDetail { pub(crate) context: ContextWgpuCore, @@ -1453,11 +1453,7 @@ impl dispatch::DeviceInterface for CoreDevice { self.wgpu_device .handle_error(cause, desc.label, "Device::create_tlas"); } - CoreTlas { - context: self.context.clone(), - wgpu_tlas, - } - .into() + CoreTlas { wgpu_tlas }.into() } fn create_sampler(&self, desc: &crate::SamplerDescriptor<'_>) -> dispatch::DispatchSampler {