mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
[deno] Use label from wgc
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
1 parent
aed6771a20
commit
040404c80b
16 files changed
+33
-69
No files matched your search
@@ -223,7 +223,6 @@ impl GPUAdapter {
|
||||
let queue_obj = deno_core::cppgc::make_cppgc_object(
|
||||
scope,
|
||||
GPUQueue {
|
||||
label: descriptor.label.clone(),
|
||||
wgpu_queue: queue,
|
||||
wgpu_device: wgpu_device.clone(),
|
||||
},
|
||||
@@ -232,7 +231,6 @@ impl GPUAdapter {
|
||||
|
||||
let device = GPUDevice {
|
||||
wgpu_device: wgpu_device.clone(),
|
||||
label: descriptor.label,
|
||||
queue_obj,
|
||||
adapter_info: self.info.clone(),
|
||||
error_handler,
|
||||
|
||||
@@ -14,6 +14,7 @@ use deno_core::webidl::WebIdlError;
|
||||
use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use wgpu_core::resource::Labeled;
|
||||
|
||||
use crate::buffer::GPUBuffer;
|
||||
use crate::error::GPUGenericError;
|
||||
@@ -24,7 +25,6 @@ use crate::texture::GPUTextureView;
|
||||
|
||||
pub struct GPUBindGroup {
|
||||
pub wgpu_bind_group: Arc<wgpu_core::binding_model::BindGroup>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPUBindGroup {
|
||||
@@ -48,7 +48,7 @@ impl GPUBindGroup {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_bind_group.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -5,6 +5,7 @@ use std::sync::Arc;
|
||||
use deno_core::op2;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use wgpu_core::resource::Labeled as _;
|
||||
|
||||
use crate::error::GPUGenericError;
|
||||
use crate::texture::GPUTextureViewDimension;
|
||||
@@ -12,7 +13,6 @@ use crate::webidl::GPUShaderStageFlags;
|
||||
|
||||
pub struct GPUBindGroupLayout {
|
||||
pub wgpu_bind_group_layout: Arc<wgpu_core::binding_model::BindGroupLayout>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl deno_core::webidl::WebIdlInterfaceConverter for GPUBindGroupLayout {
|
||||
@@ -36,7 +36,7 @@ impl GPUBindGroupLayout {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_bind_group_layout.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -13,6 +13,7 @@ use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use deno_error::JsErrorBox;
|
||||
use wgpu_core::device::HostMap as MapMode;
|
||||
use wgpu_core::resource::Labeled as _;
|
||||
|
||||
use crate::error::GPUGenericError;
|
||||
|
||||
@@ -63,8 +64,6 @@ pub struct GPUBuffer {
|
||||
pub wgpu_buffer: Arc<wgpu_core::resource::Buffer>,
|
||||
pub wgpu_device: Arc<wgpu_core::device::Device>,
|
||||
|
||||
pub label: String,
|
||||
|
||||
pub size: u64,
|
||||
pub usage: u32,
|
||||
|
||||
@@ -95,7 +94,7 @@ impl GPUBuffer {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_buffer.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -5,12 +5,12 @@ use std::sync::Arc;
|
||||
use deno_core::op2;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use wgpu_core::resource::Labeled as _;
|
||||
|
||||
use crate::error::GPUGenericError;
|
||||
|
||||
pub struct GPUCommandBuffer {
|
||||
pub wgpu_command_buffer: Arc<wgpu_core::command::CommandBuffer>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl deno_core::webidl::WebIdlInterfaceConverter for GPUCommandBuffer {
|
||||
@@ -34,7 +34,7 @@ impl GPUCommandBuffer {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_command_buffer.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -15,6 +15,7 @@ use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use deno_error::JsErrorBox;
|
||||
use wgpu_core::command::PassChannel;
|
||||
use wgpu_core::resource::Labeled as _;
|
||||
use wgpu_types::{BufferAddress, TexelCopyBufferInfo};
|
||||
|
||||
use crate::buffer::GPUBuffer;
|
||||
@@ -27,7 +28,6 @@ use crate::webidl::GPUExtent3D;
|
||||
|
||||
pub struct GPUCommandEncoder {
|
||||
pub wgpu_command_encoder: Arc<wgpu_core::command::CommandEncoder>,
|
||||
pub label: String,
|
||||
|
||||
// Weak reference to the JS object so we can attach a finalizer.
|
||||
// See `GPUDevice::create_command_encoder`.
|
||||
@@ -52,7 +52,7 @@ impl GPUCommandEncoder {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_command_encoder.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
@@ -395,7 +395,6 @@ impl GPUCommandEncoder {
|
||||
|
||||
GPUCommandBuffer {
|
||||
wgpu_command_buffer,
|
||||
label: descriptor.label,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use indexmap::IndexMap;
|
||||
use wgpu_core::resource::Labeled as _;
|
||||
|
||||
use crate::bind_group_layout::GPUBindGroupLayout;
|
||||
use crate::error::GPUGenericError;
|
||||
@@ -16,7 +17,6 @@ use crate::webidl::GPUPipelineLayoutOrGPUAutoLayoutMode;
|
||||
|
||||
pub struct GPUComputePipeline {
|
||||
pub wgpu_compute_pipeline: Arc<wgpu_core::pipeline::ComputePipeline>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPUComputePipeline {
|
||||
@@ -40,7 +40,7 @@ impl GPUComputePipeline {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_compute_pipeline.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
@@ -56,7 +56,6 @@ impl GPUComputePipeline {
|
||||
// TODO(wgpu): needs to support retrieving the label
|
||||
GPUBindGroupLayout {
|
||||
wgpu_bind_group_layout,
|
||||
label: "".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-27
@@ -15,6 +15,7 @@ use deno_error::JsErrorBox;
|
||||
use wgpu_core::binding_model::BindingResource;
|
||||
use wgpu_core::error::EmptyErrorScopeStack;
|
||||
use wgpu_core::pipeline::ProgrammableStageDescriptor;
|
||||
use wgpu_core::resource::Labeled;
|
||||
use wgpu_types::BindingType;
|
||||
|
||||
use super::bind_group::GPUBindGroup;
|
||||
@@ -48,8 +49,6 @@ pub struct GPUDevice {
|
||||
pub wgpu_device: Arc<wgpu_core::device::Device>,
|
||||
pub wgpu_adapter: Arc<wgpu_core::instance::Adapter>,
|
||||
|
||||
pub label: String,
|
||||
|
||||
pub features: SameObject<GPUSupportedFeatures>,
|
||||
pub limits: SameObject<GPUSupportedLimits>,
|
||||
pub adapter_info: Rc<SameObject<GPUAdapterInfo>>,
|
||||
@@ -101,7 +100,7 @@ impl GPUDevice {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_device.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
@@ -193,7 +192,6 @@ impl GPUDevice {
|
||||
Ok(GPUBuffer {
|
||||
wgpu_buffer,
|
||||
wgpu_device: self.wgpu_device.clone(),
|
||||
label: descriptor.label,
|
||||
size: descriptor.size,
|
||||
usage: descriptor.usage,
|
||||
map_state: RefCell::new(if descriptor.mapped_at_creation {
|
||||
@@ -251,7 +249,6 @@ impl GPUDevice {
|
||||
Ok(GPUTexture {
|
||||
wgpu_texture,
|
||||
default_view: Default::default(),
|
||||
label: descriptor.label,
|
||||
size: wgpu_descriptor.size,
|
||||
mip_level_count: wgpu_descriptor.mip_level_count,
|
||||
sample_count: wgpu_descriptor.sample_count,
|
||||
@@ -286,10 +283,7 @@ impl GPUDevice {
|
||||
|
||||
let wgpu_sampler = self.wgpu_device.create_sampler(&wgpu_descriptor);
|
||||
|
||||
Ok(GPUSampler {
|
||||
wgpu_sampler,
|
||||
label: descriptor.label,
|
||||
})
|
||||
Ok(GPUSampler { wgpu_sampler })
|
||||
}
|
||||
|
||||
#[reentrant]
|
||||
@@ -366,7 +360,6 @@ impl GPUDevice {
|
||||
|
||||
Ok(GPUBindGroupLayout {
|
||||
wgpu_bind_group_layout,
|
||||
label: descriptor.label,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -398,7 +391,6 @@ impl GPUDevice {
|
||||
|
||||
GPUPipelineLayout {
|
||||
wgpu_pipeline_layout,
|
||||
label: descriptor.label,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,10 +447,7 @@ impl GPUDevice {
|
||||
|
||||
let wgpu_bind_group = self.wgpu_device.create_bind_group(&wgpu_descriptor);
|
||||
|
||||
GPUBindGroup {
|
||||
wgpu_bind_group,
|
||||
label: descriptor.label,
|
||||
}
|
||||
GPUBindGroup { wgpu_bind_group }
|
||||
}
|
||||
|
||||
#[reentrant]
|
||||
@@ -491,7 +480,7 @@ impl GPUDevice {
|
||||
|
||||
GPUShaderModule {
|
||||
wgpu_shader_module,
|
||||
label: descriptor.label,
|
||||
|
||||
compilation_info,
|
||||
}
|
||||
}
|
||||
@@ -503,13 +492,11 @@ impl GPUDevice {
|
||||
&self,
|
||||
#[webidl] descriptor: super::compute_pipeline::GPUComputePipelineDescriptor,
|
||||
) -> GPUComputePipeline {
|
||||
let label = descriptor.label.clone();
|
||||
let wgpu_descriptor = transform_compute_pipeline_descriptor(descriptor);
|
||||
let wgpu_compute_pipeline =
|
||||
self.wgpu_device.create_compute_pipeline(wgpu_descriptor);
|
||||
GPUComputePipeline {
|
||||
wgpu_compute_pipeline,
|
||||
label,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,14 +507,12 @@ impl GPUDevice {
|
||||
&self,
|
||||
#[webidl] descriptor: super::render_pipeline::GPURenderPipelineDescriptor,
|
||||
) -> Result<GPURenderPipeline, JsErrorBox> {
|
||||
let label = descriptor.label.clone();
|
||||
let wgpu_descriptor =
|
||||
self.transform_render_pipeline_descriptor(descriptor)?;
|
||||
let wgpu_render_pipeline =
|
||||
self.wgpu_device.create_render_pipeline(wgpu_descriptor);
|
||||
Ok(GPURenderPipeline {
|
||||
wgpu_render_pipeline,
|
||||
label,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -544,7 +529,6 @@ impl GPUDevice {
|
||||
let resolver = v8::PromiseResolver::new(scope).unwrap();
|
||||
let promise = resolver.get_promise(scope);
|
||||
|
||||
let label = descriptor.label.clone();
|
||||
let wgpu_descriptor = transform_compute_pipeline_descriptor(descriptor);
|
||||
match self
|
||||
.wgpu_device
|
||||
@@ -553,7 +537,6 @@ impl GPUDevice {
|
||||
Ok(wgpu_compute_pipeline) => {
|
||||
let pipeline = GPUComputePipeline {
|
||||
wgpu_compute_pipeline,
|
||||
label,
|
||||
};
|
||||
let val = make_cppgc_object(scope, pipeline).into();
|
||||
resolver.resolve(scope, val);
|
||||
@@ -581,8 +564,6 @@ impl GPUDevice {
|
||||
scope: &mut v8::HandleScope,
|
||||
#[webidl] descriptor: super::render_pipeline::GPURenderPipelineDescriptor,
|
||||
) -> Result<v8::Global<v8::Promise>, JsErrorBox> {
|
||||
let label = descriptor.label.clone();
|
||||
|
||||
let wgpu_descriptor =
|
||||
self.transform_render_pipeline_descriptor(descriptor)?;
|
||||
|
||||
@@ -596,7 +577,6 @@ impl GPUDevice {
|
||||
Ok(wgpu_render_pipeline) => {
|
||||
let render_pipeline = GPURenderPipeline {
|
||||
wgpu_render_pipeline,
|
||||
label,
|
||||
};
|
||||
let val = make_cppgc_object(scope, render_pipeline).into();
|
||||
resolver.resolve(scope, val);
|
||||
@@ -642,7 +622,6 @@ impl GPUDevice {
|
||||
|
||||
let encoder = GPUCommandEncoder {
|
||||
wgpu_command_encoder,
|
||||
label,
|
||||
#[cfg(target_vendor = "apple")]
|
||||
weak: std::sync::OnceLock::new(),
|
||||
};
|
||||
@@ -751,7 +730,6 @@ impl GPUDevice {
|
||||
wgpu_query_set,
|
||||
r#type: descriptor.r#type,
|
||||
count: descriptor.count,
|
||||
label: descriptor.label,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use std::sync::Arc;
|
||||
use wgpu_core::resource::Labeled as _;
|
||||
|
||||
use crate::error::GPUGenericError;
|
||||
|
||||
pub struct GPUPipelineLayout {
|
||||
pub wgpu_pipeline_layout: Arc<wgpu_core::binding_model::PipelineLayout>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPUPipelineLayout {
|
||||
@@ -36,7 +36,7 @@ impl GPUPipelineLayout {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_pipeline_layout.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -7,6 +7,7 @@ use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use deno_error::JsErrorBox;
|
||||
use wgpu_core::resource::Labeled;
|
||||
|
||||
use crate::error::GPUGenericError;
|
||||
|
||||
@@ -14,7 +15,6 @@ pub struct GPUQuerySet {
|
||||
pub wgpu_query_set: Arc<wgpu_core::resource::QuerySet>,
|
||||
pub r#type: GPUQueryType,
|
||||
pub count: u32,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPUQuerySet {
|
||||
@@ -38,7 +38,7 @@ impl GPUQuerySet {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_query_set.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -12,6 +12,7 @@ use deno_core::v8;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use deno_error::JsErrorBox;
|
||||
use wgpu_core::resource::Labeled;
|
||||
|
||||
use crate::buffer::GPUBuffer;
|
||||
use crate::command_buffer::GPUCommandBuffer;
|
||||
@@ -23,8 +24,6 @@ use crate::webidl::GPUExtent3D;
|
||||
use crate::webidl::GPUOrigin3D;
|
||||
|
||||
pub struct GPUQueue {
|
||||
pub label: String,
|
||||
|
||||
pub wgpu_queue: Arc<wgpu_core::device::queue::Queue>,
|
||||
pub wgpu_device: Arc<wgpu_core::device::Device>,
|
||||
}
|
||||
@@ -46,7 +45,7 @@ impl GPUQueue {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_queue.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -9,6 +9,7 @@ use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use indexmap::IndexMap;
|
||||
use wgpu_core::resource::Labeled;
|
||||
|
||||
use crate::bind_group_layout::GPUBindGroupLayout;
|
||||
use crate::error::GPUGenericError;
|
||||
@@ -20,7 +21,6 @@ use crate::webidl::GPUPipelineLayoutOrGPUAutoLayoutMode;
|
||||
|
||||
pub struct GPURenderPipeline {
|
||||
pub wgpu_render_pipeline: Arc<wgpu_core::pipeline::RenderPipeline>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPURenderPipeline {
|
||||
@@ -44,7 +44,7 @@ impl GPURenderPipeline {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_render_pipeline.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
@@ -57,10 +57,8 @@ impl GPURenderPipeline {
|
||||
let wgpu_bind_group_layout =
|
||||
self.wgpu_render_pipeline.get_bind_group_layout(index);
|
||||
|
||||
// TODO(wgpu): needs to add a way to retrieve the label
|
||||
GPUBindGroupLayout {
|
||||
wgpu_bind_group_layout,
|
||||
label: "".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ use deno_core::op2;
|
||||
use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use wgpu_core::resource::Labeled;
|
||||
|
||||
use crate::error::GPUGenericError;
|
||||
|
||||
pub struct GPUSampler {
|
||||
pub wgpu_sampler: Arc<wgpu_core::resource::Sampler>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPUSampler {
|
||||
@@ -35,7 +35,7 @@ impl GPUSampler {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_sampler.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -8,12 +8,12 @@ use deno_core::v8;
|
||||
use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use wgpu_core::resource::Labeled;
|
||||
|
||||
use crate::error::GPUGenericError;
|
||||
|
||||
pub struct GPUShaderModule {
|
||||
pub wgpu_shader_module: Arc<wgpu_core::pipeline::ShaderModule>,
|
||||
pub label: String,
|
||||
pub compilation_info: v8::Global<v8::Object>,
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ impl GPUShaderModule {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_shader_module.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
@@ -150,7 +150,6 @@ impl GPUCanvasContext {
|
||||
let texture = GPUTexture {
|
||||
wgpu_texture: output.texture.unwrap(),
|
||||
default_view: Default::default(),
|
||||
label: "".to_string(),
|
||||
size: wgpu_types::Extent3d {
|
||||
width: *self.width.borrow(),
|
||||
height: *self.height.borrow(),
|
||||
|
||||
@@ -8,6 +8,7 @@ use deno_core::webidl::WebIdlInterfaceConverter;
|
||||
use deno_core::GarbageCollected;
|
||||
use deno_core::WebIDL;
|
||||
use deno_error::JsErrorBox;
|
||||
use wgpu_core::resource::Labeled;
|
||||
use wgpu_core::resource::ParentDevice;
|
||||
use wgpu_types::AstcBlock;
|
||||
use wgpu_types::AstcChannel;
|
||||
@@ -46,8 +47,6 @@ pub struct GPUTexture {
|
||||
pub wgpu_texture: Arc<wgpu_core::resource::Texture>,
|
||||
pub default_view: OnceLock<Arc<wgpu_core::resource::TextureView>>,
|
||||
|
||||
pub label: String,
|
||||
|
||||
pub size: Extent3d,
|
||||
pub mip_level_count: u32,
|
||||
pub sample_count: u32,
|
||||
@@ -86,7 +85,7 @@ impl GPUTexture {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_texture.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
@@ -168,10 +167,7 @@ impl GPUTexture {
|
||||
|
||||
let wgpu_texture_view = self.wgpu_texture.create_view(&wgpu_descriptor);
|
||||
|
||||
Ok(GPUTextureView {
|
||||
wgpu_texture_view,
|
||||
label: descriptor.label,
|
||||
})
|
||||
Ok(GPUTextureView { wgpu_texture_view })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +247,6 @@ impl From<GPUTextureAspect> for TextureAspect {
|
||||
|
||||
pub struct GPUTextureView {
|
||||
pub wgpu_texture_view: Arc<wgpu_core::resource::TextureView>,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
impl WebIdlInterfaceConverter for GPUTextureView {
|
||||
@@ -276,7 +271,7 @@ impl GPUTextureView {
|
||||
#[getter]
|
||||
#[string]
|
||||
fn label(&self) -> String {
|
||||
self.label.clone()
|
||||
self.wgpu_texture_view.label().to_string()
|
||||
}
|
||||
#[setter]
|
||||
#[string]
|
||||
|
||||
Reference in new issue
Block a user