mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 15:00:57 +01:00
[deno] Use GPUTexture::* from wgc
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
0e7fb34d97
commit
726f0abb48
3 files changed
+5
-19
No files matched your search
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<wgpu_core::resource::Texture>,
|
||||
pub default_view: OnceLock<Arc<wgpu_core::resource::TextureView>>,
|
||||
|
||||
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]
|
||||
|
||||
Reference in new issue
Block a user