chore: update to wgpu 28 and cosmic-text 0.19

This commit is contained in:
Hojjat 2026-04-22 14:36:39 -06:00 committed by Michael Murphy
parent aa2a870c35
commit 90d2c418a7
17 changed files with 113 additions and 185 deletions

View file

@ -132,7 +132,7 @@ impl Atlas {
match &entry {
Entry::Contiguous(allocation) => {
self.upload_allocation(
pixels, width, 0, allocation, device, encoder, belt,
pixels, width, 0, allocation, encoder, belt,
);
}
Entry::Fragmented { fragments, .. } => {
@ -145,7 +145,6 @@ impl Atlas {
width,
offset,
&fragment.allocation,
device,
encoder,
belt,
);
@ -312,7 +311,6 @@ impl Atlas {
image_width: u32,
offset: usize,
allocation: &Allocation,
device: &wgpu::Device,
encoder: &mut wgpu::CommandEncoder,
belt: &mut wgpu::util::StagingBelt,
) {
@ -334,7 +332,6 @@ impl Atlas {
let buffer_slice = belt.allocate(
wgpu::BufferSize::new(total_bytes as u64).unwrap(),
wgpu::BufferSize::new(8 * 4).unwrap(),
device,
);
const PIXEL: usize = 4;

View file

@ -38,7 +38,10 @@ impl Cache {
raster: Raster {
cache: crate::image::raster::Cache::default(),
pending: HashMap::new(),
belt: wgpu::util::StagingBelt::new(2 * 1024 * 1024),
belt: wgpu::util::StagingBelt::new(
device.clone(),
2 * 1024 * 1024,
),
},
#[cfg(feature = "svg")]
vector: crate::image::vector::Cache::default(),
@ -451,7 +454,10 @@ mod worker {
backend,
texture_layout,
shell: shell.clone(),
belt: wgpu::util::StagingBelt::new(4 * 1024 * 1024),
belt: wgpu::util::StagingBelt::new(
device.clone(),
4 * 1024 * 1024,
),
jobs: jobs_receiver,
output: work_sender,
quit: quit_receiver,

View file

@ -45,7 +45,7 @@ impl Pipeline {
address_mode_w: wgpu::AddressMode::ClampToEdge,
min_filter: wgpu::FilterMode::Nearest,
mag_filter: wgpu::FilterMode::Nearest,
mipmap_filter: wgpu::FilterMode::Nearest,
mipmap_filter: wgpu::MipmapFilterMode::Nearest,
..Default::default()
});
@ -55,7 +55,7 @@ impl Pipeline {
address_mode_w: wgpu::AddressMode::ClampToEdge,
min_filter: wgpu::FilterMode::Linear,
mag_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::MipmapFilterMode::Linear,
..Default::default()
});
@ -106,8 +106,8 @@ impl Pipeline {
let layout =
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("iced_wgpu::image pipeline layout"),
push_constant_ranges: &[],
bind_group_layouts: &[&constant_layout, &texture_layout],
immediate_size: 0,
});
let shader =
@ -191,7 +191,7 @@ impl Pipeline {
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,
cache: None,
});
@ -528,7 +528,6 @@ impl Layer {
&self.uniforms,
0,
(bytes.len() as u64).try_into().expect("Sized uniforms"),
device,
)
.copy_from_slice(bytes);
@ -539,11 +538,11 @@ impl Layer {
let mut offset = 0;
if !nearest.is_empty() {
offset += self.instances.write(device, encoder, belt, 0, nearest);
offset += self.instances.write(encoder, belt, 0, nearest);
}
if !linear.is_empty() {
let _ = self.instances.write(device, encoder, belt, offset, linear);
let _ = self.instances.write(encoder, belt, offset, linear);
}
}