diff --git a/deno_webgpu/device.rs b/deno_webgpu/device.rs index 6c27e56e1..a9d9fdf47 100644 --- a/deno_webgpu/device.rs +++ b/deno_webgpu/device.rs @@ -248,9 +248,6 @@ impl GPUDevice { Ok(GPUTexture { wgpu_texture, default_view: Default::default(), - size: wgpu_descriptor.size, - mip_level_count: wgpu_descriptor.mip_level_count, - sample_count: wgpu_descriptor.sample_count, dimension: descriptor.dimension, format: descriptor.format, usage: GPUTextureUsageFlags(usage), diff --git a/deno_webgpu/surface.rs b/deno_webgpu/surface.rs index 191e19ebf..1f658fbba 100644 --- a/deno_webgpu/surface.rs +++ b/deno_webgpu/surface.rs @@ -150,13 +150,6 @@ impl GPUCanvasContext { let texture = GPUTexture { wgpu_texture: output.texture.unwrap(), default_view: Default::default(), - size: wgpu_types::Extent3d { - width: *self.width.borrow(), - height: *self.height.borrow(), - depth_or_array_layers: 1, - }, - mip_level_count: 0, - sample_count: 0, dimension: crate::texture::GPUTextureDimension::D2, format: config.format.clone(), usage: config.usage, diff --git a/deno_webgpu/texture.rs b/deno_webgpu/texture.rs index fa777b982..eb9fdd931 100644 --- a/deno_webgpu/texture.rs +++ b/deno_webgpu/texture.rs @@ -12,7 +12,6 @@ use wgpu_core::resource::Labeled; use wgpu_core::resource::ParentDevice; use wgpu_types::AstcBlock; use wgpu_types::AstcChannel; -use wgpu_types::Extent3d; use wgpu_types::TextureAspect; use wgpu_types::TextureDimension; use wgpu_types::TextureFormat; @@ -47,9 +46,6 @@ pub struct GPUTexture { pub wgpu_texture: Arc, pub default_view: OnceLock>, - pub size: Extent3d, - pub mip_level_count: u32, - pub sample_count: u32, pub dimension: GPUTextureDimension, pub format: GPUTextureFormat, pub usage: GPUTextureUsageFlags, @@ -95,23 +91,23 @@ impl GPUTexture { #[getter] fn width(&self) -> u32 { - self.size.width + self.wgpu_texture.descriptor().size.width } #[getter] fn height(&self) -> u32 { - self.size.height + self.wgpu_texture.descriptor().size.height } #[getter] fn depth_or_array_layers(&self) -> u32 { - self.size.depth_or_array_layers + self.wgpu_texture.descriptor().size.depth_or_array_layers } #[getter] fn mip_level_count(&self) -> u32 { - self.mip_level_count + self.wgpu_texture.descriptor().mip_level_count } #[getter] fn sample_count(&self) -> u32 { - self.sample_count + self.wgpu_texture.descriptor().sample_count } #[getter] #[string]