Remove ContextCore from CoreTextureView

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 633081c80e
commit e55a1fe3d0
2 files changed
+8 -14

No files matched your search

+1 -1
View File
@@ -73,7 +73,7 @@ impl TextureView {
#[cfg(wgpu_core)]
pub unsafe fn as_hal<A: hal::Api>(&self) -> Option<impl Deref<Target = A::TextureView>> {
let view = self.inner.as_core_opt()?;
unsafe { view.context.texture_view_as_hal::<A>(view) }
unsafe { view.as_hal::<A>() }
}
/// Returns the underlying [`webgpu::GpuTextureView`] handle if this view
+7 -13
View File
@@ -202,13 +202,6 @@ impl ContextWgpuCore {
.is_ok()
}
pub unsafe fn texture_view_as_hal<A: hal::Api>(
&self,
texture_view: &CoreTextureView,
) -> Option<impl Deref<Target = A::TextureView>> {
unsafe { texture_view.wgpu_texture_view.clone().as_hal::<A>() }
}
/// This method will start the wgpu_core level command recording.
pub unsafe fn command_encoder_as_hal_mut<
A: hal::Api,
@@ -378,10 +371,15 @@ pub struct CoreTexture {
#[derive(Debug, Clone)]
pub struct CoreTextureView {
pub(crate) context: ContextWgpuCore,
pub(crate) wgpu_texture_view: Arc<wgc::resource::TextureView>,
}
impl CoreTextureView {
pub unsafe fn as_hal<A: hal::Api>(&self) -> Option<impl Deref<Target = A::TextureView>> {
unsafe { self.wgpu_texture_view.clone().as_hal::<A>() }
}
}
#[derive(Debug, Clone)]
pub struct CoreExternalTexture {
pub(crate) wgpu_external_texture: Arc<wgc::resource::ExternalTexture>,
@@ -1876,11 +1874,7 @@ impl dispatch::TextureInterface for CoreTexture {
.device()
.handle_error(cause, desc.label, "Texture::create_view");
}
CoreTextureView {
context: self.context.clone(),
wgpu_texture_view,
}
.into()
CoreTextureView { wgpu_texture_view }.into()
}
fn destroy(&self) {