mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
Resolve Rust 1.66 clippy lints (#3304)
This commit is contained in:
1 parent
f14bee6740
commit
3cc6621fd3
5 files changed
+8
-8
No files matched your search
@@ -5242,8 +5242,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
};
|
||||
|
||||
let num_frames = present::DESIRED_NUM_FRAMES
|
||||
.max(*caps.swap_chain_sizes.start())
|
||||
.min(*caps.swap_chain_sizes.end());
|
||||
.clamp(*caps.swap_chain_sizes.start(), *caps.swap_chain_sizes.end());
|
||||
let mut hal_config = hal::SurfaceConfiguration {
|
||||
swap_chain_size: num_frames,
|
||||
present_mode: config.present_mode,
|
||||
|
||||
@@ -124,9 +124,10 @@ impl<A: hal::Api> Example<A> {
|
||||
|
||||
let window_size: (u32, u32) = window.inner_size().into();
|
||||
let surface_config = hal::SurfaceConfiguration {
|
||||
swap_chain_size: DESIRED_FRAMES
|
||||
.max(*surface_caps.swap_chain_sizes.start())
|
||||
.min(*surface_caps.swap_chain_sizes.end()),
|
||||
swap_chain_size: DESIRED_FRAMES.clamp(
|
||||
*surface_caps.swap_chain_sizes.start(),
|
||||
*surface_caps.swap_chain_sizes.end(),
|
||||
),
|
||||
present_mode: wgt::PresentMode::Fifo,
|
||||
composite_alpha_mode: wgt::CompositeAlphaMode::Opaque,
|
||||
format: wgt::TextureFormat::Bgra8UnormSrgb,
|
||||
|
||||
@@ -322,7 +322,7 @@ impl framework::Example for Skybox {
|
||||
queue,
|
||||
&wgpu::TextureDescriptor {
|
||||
size,
|
||||
mip_level_count: max_mips as u32,
|
||||
mip_level_count: max_mips,
|
||||
sample_count: 1,
|
||||
dimension: wgpu::TextureDimension::D2,
|
||||
format: skybox_format,
|
||||
|
||||
@@ -117,7 +117,7 @@ impl DeviceExt for crate::Device {
|
||||
queue.write_texture(
|
||||
crate::ImageCopyTexture {
|
||||
texture: &texture,
|
||||
mip_level: mip as u32,
|
||||
mip_level: mip,
|
||||
origin: crate::Origin3d {
|
||||
x: 0,
|
||||
y: 0,
|
||||
|
||||
@@ -124,7 +124,7 @@ pub fn compare_image_output(
|
||||
|
||||
write_png(actual_path, width, height, data, png::Compression::Fast);
|
||||
write_png(
|
||||
&difference_path,
|
||||
difference_path,
|
||||
width,
|
||||
height,
|
||||
&difference_data,
|
||||
|
||||
Reference in new issue
Block a user