summaryrefslogtreecommitdiffstats
path: root/wgpu/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-10-27 03:58:45 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-10-27 03:58:45 +0200
commit65823875791ecebf24d049cc0782e7475a37899b (patch)
tree1088c656ef7ad9782374952045022d2c104931b2 /wgpu/src
parent8cc19de254c37d3123d5ea1b6513f1f34d35c7c8 (diff)
parentf1b1344d59fa7354615f560bd25ed01ad0c9f865 (diff)
downloadiced-65823875791ecebf24d049cc0782e7475a37899b.tar.gz
iced-65823875791ecebf24d049cc0782e7475a37899b.tar.bz2
iced-65823875791ecebf24d049cc0782e7475a37899b.zip
Merge branch 'master' into text-editor
Diffstat (limited to '')
-rw-r--r--wgpu/src/buffer.rs2
-rw-r--r--wgpu/src/color.rs6
-rw-r--r--wgpu/src/geometry.rs4
-rw-r--r--wgpu/src/image/atlas.rs12
-rw-r--r--wgpu/src/image/vector.rs2
-rw-r--r--wgpu/src/layer.rs2
-rw-r--r--wgpu/src/lib.rs6
-rw-r--r--wgpu/src/text.rs2
-rw-r--r--wgpu/src/triangle.rs12
-rw-r--r--wgpu/src/window/compositor.rs6
10 files changed, 24 insertions, 30 deletions
diff --git a/wgpu/src/buffer.rs b/wgpu/src/buffer.rs
index 94122187..ef00c58f 100644
--- a/wgpu/src/buffer.rs
+++ b/wgpu/src/buffer.rs
@@ -87,7 +87,7 @@ impl<T: bytemuck::Pod> Buffer<T> {
/// Clears any temporary data (i.e. offsets) from the buffer.
pub fn clear(&mut self) {
- self.offsets.clear()
+ self.offsets.clear();
}
/// Returns the offset at `index`, if it exists.
diff --git a/wgpu/src/color.rs b/wgpu/src/color.rs
index a1025601..20827e3c 100644
--- a/wgpu/src/color.rs
+++ b/wgpu/src/color.rs
@@ -12,7 +12,7 @@ pub fn convert(
let sampler = device.create_sampler(&wgpu::SamplerDescriptor {
label: Some("iced_wgpu.offscreen.sampler"),
- ..Default::default()
+ ..wgpu::SamplerDescriptor::default()
});
//sampler in 0
@@ -102,10 +102,10 @@ pub fn convert(
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleList,
front_face: wgpu::FrontFace::Cw,
- ..Default::default()
+ ..wgpu::PrimitiveState::default()
},
depth_stencil: None,
- multisample: Default::default(),
+ multisample: wgpu::MultisampleState::default(),
multiview: None,
});
diff --git a/wgpu/src/geometry.rs b/wgpu/src/geometry.rs
index 63a59c05..655362b7 100644
--- a/wgpu/src/geometry.rs
+++ b/wgpu/src/geometry.rs
@@ -480,7 +480,7 @@ impl Frame {
},
size: self.size,
}),
- ))
+ ));
}
}
Buffer::Gradient(buffer) => {
@@ -493,7 +493,7 @@ impl Frame {
},
size: self.size,
}),
- ))
+ ));
}
}
}
diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs
index e3de1290..789e35b4 100644
--- a/wgpu/src/image/atlas.rs
+++ b/wgpu/src/image/atlas.rs
@@ -86,7 +86,7 @@ impl Atlas {
entry
};
- log::info!("Allocated atlas entry: {:?}", entry);
+ log::info!("Allocated atlas entry: {entry:?}");
// It is a webgpu requirement that:
// BufferCopyView.layout.bytes_per_row % wgpu::COPY_BYTES_PER_ROW_ALIGNMENT == 0
@@ -104,7 +104,7 @@ impl Atlas {
padded_data[offset..offset + 4 * width as usize].copy_from_slice(
&data[row * 4 * width as usize..(row + 1) * 4 * width as usize],
- )
+ );
}
match &entry {
@@ -139,13 +139,13 @@ impl Atlas {
}
}
- log::info!("Current atlas: {:?}", self);
+ log::info!("Current atlas: {self:?}");
Some(entry)
}
pub fn remove(&mut self, entry: &Entry) {
- log::info!("Removing atlas entry: {:?}", entry);
+ log::info!("Removing atlas entry: {entry:?}");
match entry {
Entry::Contiguous(allocation) => {
@@ -237,7 +237,7 @@ impl Atlas {
}));
}
}
- _ => {}
+ Layer::Full => {}
}
}
@@ -258,7 +258,7 @@ impl Atlas {
}
fn deallocate(&mut self, allocation: &Allocation) {
- log::info!("Deallocating atlas: {:?}", allocation);
+ log::info!("Deallocating atlas: {allocation:?}");
match allocation {
Allocation::Full { layer } => {
diff --git a/wgpu/src/image/vector.rs b/wgpu/src/image/vector.rs
index 2c03d36b..6582bb82 100644
--- a/wgpu/src/image/vector.rs
+++ b/wgpu/src/image/vector.rs
@@ -152,7 +152,7 @@ impl Cache {
let allocation =
atlas.upload(device, encoder, width, height, &rgba)?;
- log::debug!("allocating {} {}x{}", id, width, height);
+ log::debug!("allocating {id} {width}x{height}");
let _ = self.svg_hits.insert(id);
let _ = self.rasterized_hits.insert(key);
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 10b3332d..b251538e 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -215,7 +215,7 @@ impl<'a> Layer<'a> {
translation,
primitive,
current_layer,
- )
+ );
}
}
Primitive::Clip { bounds, content } => {
diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs
index 2f483751..6d26723e 100644
--- a/wgpu/src/lib.rs
+++ b/wgpu/src/lib.rs
@@ -26,14 +26,8 @@
//missing_docs,
unsafe_code,
unused_results,
- clippy::extra_unused_lifetimes,
- clippy::from_over_into,
- clippy::needless_borrow,
- clippy::new_without_default,
- clippy::useless_conversion,
rustdoc::broken_intra_doc_links
)]
-#![allow(clippy::inherent_to_string, clippy::type_complexity)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod layer;
pub mod primitive;
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index f746be63..08a8bea6 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -61,7 +61,7 @@ impl Pipeline {
self.renderers.push(glyphon::TextRenderer::new(
&mut self.atlas,
device,
- Default::default(),
+ wgpu::MultisampleState::default(),
None,
));
}
diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs
index d430e607..644c9f84 100644
--- a/wgpu/src/triangle.rs
+++ b/wgpu/src/triangle.rs
@@ -329,12 +329,12 @@ impl Pipeline {
fn fragment_target(
texture_format: wgpu::TextureFormat,
-) -> Option<wgpu::ColorTargetState> {
- Some(wgpu::ColorTargetState {
+) -> wgpu::ColorTargetState {
+ wgpu::ColorTargetState {
format: texture_format,
blend: Some(wgpu::BlendState::ALPHA_BLENDING),
write_mask: wgpu::ColorWrites::ALL,
- })
+ }
}
fn primitive_state() -> wgpu::PrimitiveState {
@@ -349,7 +349,7 @@ fn multisample_state(
antialiasing: Option<Antialiasing>,
) -> wgpu::MultisampleState {
wgpu::MultisampleState {
- count: antialiasing.map(|a| a.sample_count()).unwrap_or(1),
+ count: antialiasing.map(Antialiasing::sample_count).unwrap_or(1),
mask: !0,
alpha_to_coverage_enabled: false,
}
@@ -521,7 +521,7 @@ mod solid {
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "solid_fs_main",
- targets: &[triangle::fragment_target(format)],
+ targets: &[Some(triangle::fragment_target(format))],
}),
primitive: triangle::primitive_state(),
depth_stencil: None,
@@ -698,7 +698,7 @@ mod gradient {
fragment: Some(wgpu::FragmentState {
module: &shader,
entry_point: "gradient_fs_main",
- targets: &[triangle::fragment_target(format)],
+ targets: &[Some(triangle::fragment_target(format))],
}),
primitive: triangle::primitive_state(),
depth_stencil: None,
diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs
index a9521a15..1ddbe5fe 100644
--- a/wgpu/src/window/compositor.rs
+++ b/wgpu/src/window/compositor.rs
@@ -35,7 +35,7 @@ impl<Theme> Compositor<Theme> {
..Default::default()
});
- log::info!("{:#?}", settings);
+ log::info!("{settings:#?}");
#[cfg(not(target_arch = "wasm32"))]
if log::max_level() >= log::LevelFilter::Info {
@@ -43,7 +43,7 @@ impl<Theme> Compositor<Theme> {
.enumerate_adapters(settings.internal_backend)
.map(|adapter| adapter.get_info())
.collect();
- log::info!("Available adapters: {:#?}", available_adapters);
+ log::info!("Available adapters: {available_adapters:#?}");
}
#[allow(unsafe_code)]
@@ -83,7 +83,7 @@ impl<Theme> Compositor<Theme> {
})
})?;
- log::info!("Selected format: {:?}", format);
+ log::info!("Selected format: {format:?}");
#[cfg(target_arch = "wasm32")]
let limits = [wgpu::Limits::downlevel_webgl2_defaults()