From 8106028f23cf2a0496940e53b6634d498de261c5 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:31:06 +0200 Subject: [PATCH] remove `ResourceInfo.label()` --- wgpu-core/src/command/mod.rs | 5 +---- wgpu-core/src/device/resource.rs | 2 +- wgpu-core/src/resource.rs | 15 --------------- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 65d2d76d8..b237a375a 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -506,10 +506,7 @@ impl CommandBuffer { } pub(crate) fn extract_baked_commands(&mut self) -> BakedCommands { - log::trace!( - "Extracting BakedCommands from CommandBuffer {:?}", - self.info.label() - ); + log::trace!("Extracting BakedCommands from {}", self.error_ident()); let data = self.data.lock().take().unwrap(); BakedCommands { encoder: data.encoder.raw, diff --git a/wgpu-core/src/device/resource.rs b/wgpu-core/src/device/resource.rs index 23db585fd..4009ecfe8 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("adapter", &self.adapter.info.label()) + .field("label", &self.info.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 412ec8969..9efe5bff3 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -103,21 +103,6 @@ impl ResourceInfo { } } - pub(crate) fn label(&self) -> &dyn Debug - where - Id: Debug, - { - if !self.label.is_empty() { - return &self.label; - } - - if let Some(id) = &self.id { - return id; - } - - &"" - } - pub(crate) fn id(&self) -> Id { self.id.unwrap() }