diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index ca789d0a0..50bf95413 100644 --- a/wgpu-core/src/device/resource.rs +++ b/wgpu-core/src/device/resource.rs @@ -151,7 +151,7 @@ pub(crate) enum DeferredDestroy { impl std::fmt::Debug for Device { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("Device") - .field("label", &self.info.label) + .field("label", &self.label()) .field("limits", &self.limits) .field("features", &self.features) .field("downlevel", &self.downlevel) diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index 9efe5bff3..b420234d9 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -71,7 +71,7 @@ pub(crate) struct ResourceInfo { submission_index: AtomicUsize, /// The `label` from the descriptor used to create the resource. - pub(crate) label: String, + label: String, } impl Drop for ResourceInfo { @@ -751,7 +751,7 @@ impl Buffer { device: Arc::clone(&self.device), submission_index: self.info.submission_index(), tracker_index: self.info.tracker_index(), - label: self.info.label.clone(), + label: self.label().to_owned(), bind_groups, })) }; @@ -1119,7 +1119,7 @@ impl Texture { device: Arc::clone(&self.device), tracker_index: self.info.tracker_index(), submission_index: self.info.submission_index(), - label: self.info.label.clone(), + label: self.label().to_owned(), })) };