From f55fa6e2179b6349b6345d7ca3e97df5544580ea Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:49:48 +0200 Subject: [PATCH] make `ResourceInfo.label` private --- wgpu-core/src/device/resource.rs | 2 +- wgpu-core/src/resource.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index ca789d0a03..50bf954130 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 9efe5bff3e..b420234d9a 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(), })) };