From e1d2c81ec0616f680d588277bf15b5ecfd0972f7 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 10 Jun 2021 11:38:53 -0400 Subject: [PATCH] build and clippy fixes --- wgpu-core/src/command/mod.rs | 1 - wgpu-core/src/device/mod.rs | 5 +++-- wgpu-core/src/device/trace.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index c33c862998..68e72f868e 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -70,7 +70,6 @@ impl CommandBuffer { #[cfg(feature = "trace")] enable_tracing: bool, #[cfg(debug_assertions)] label: &Label, ) -> Self { - use crate::LabelHelpers as _; CommandBuffer { raw: vec![raw], status: CommandEncoderStatus::Recording, diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 1c34739009..25478b116a 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -3448,6 +3448,7 @@ impl Global { device.features, #[cfg(feature = "trace")] device.trace.is_some(), + #[cfg(debug_assertions)] &desc.label, ); @@ -4412,14 +4413,14 @@ impl Global { #[cfg(feature = "trace")] if let Some(ref trace) = device.trace { let mut trace = trace.lock(); - let size = sub_range.size_to(buffer.size); + let size = range.end - range.start; let data = trace.make_binary("bin", unsafe { std::slice::from_raw_parts(ptr.as_ptr(), size as usize) }); trace.add(trace::Action::WriteBuffer { id: buffer_id, data, - range: sub_range.offset..sub_range.offset + size, + range: range.clone(), queued: false, }); } diff --git a/wgpu-core/src/device/trace.rs b/wgpu-core/src/device/trace.rs index 340dc8d4aa..43bc0c4f29 100644 --- a/wgpu-core/src/device/trace.rs +++ b/wgpu-core/src/device/trace.rs @@ -22,7 +22,7 @@ pub(crate) fn new_render_bundle_encoder_descriptor<'a>( label, color_formats: Cow::Borrowed(&context.attachments.colors), depth_stencil_format: context.attachments.depth_stencil, - sample_count: context.sample_count as u32, + sample_count: context.sample_count, } }