Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 53 additions & 126 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ repository = "https://github.com/iced-rs/iced"
homepage = "https://iced.rs"
categories = ["gui"]
keywords = ["gui", "ui", "graphics", "interface", "widgets"]
rust-version = "1.89"
rust-version = "1.92"

[workspace.dependencies]
iced = { version = "0.14.0", path = "." }
Expand Down Expand Up @@ -238,10 +238,9 @@ async-std = "1.0"
bitflags = "2.5"
bytemuck = { version = "1.0", features = ["derive"] }
bytes = "1.6"
cosmic-text = { git = "https://github.com/pop-os/cosmic-text.git" }
# cosmic-text = "0.10"
cosmic-text = "0.19"
cryoglyph = { git = "https://github.com/iced-rs/cryoglyph.git", rev = "e429a025df36ab8145708acb309080ae3deec17a" }
dark-light = "1.0"
cryoglyph = { package = "cryoglyph", git = "https://github.com/pop-os/glyphon.git", tag = "cosmic-0.14" }
resvg = "0.45"
web-sys = "0.3.69"
guillotiere = "0.6"
Expand Down Expand Up @@ -288,7 +287,7 @@ url = "2.5"
wasm-bindgen-futures = "0.4"
wasmtimer = "0.4.2"
web-time = "1.1"
wgpu = { version = "27.0", default-features = false, features = [
wgpu = { version = "28.0", default-features = false, features = [
"std",
"wgsl",
] }
Expand Down
12 changes: 7 additions & 5 deletions examples/custom_shader/src/scene/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl Pipeline {
address_mode_w: wgpu::AddressMode::ClampToEdge,
mag_filter: wgpu::FilterMode::Linear,
min_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::MipmapFilterMode::Linear,
..Default::default()
});

Expand Down Expand Up @@ -223,7 +223,7 @@ impl Pipeline {
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("cubes pipeline layout"),
bind_group_layouts: &[&uniform_bind_group_layout],
push_constant_ranges: &[],
immediate_size: 0,
});

let shader =
Expand Down Expand Up @@ -280,7 +280,7 @@ impl Pipeline {
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -388,6 +388,7 @@ impl Pipeline {
),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});

pass.set_viewport(
Expand Down Expand Up @@ -478,7 +479,7 @@ impl DepthPipeline {
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("cubes.depth_pipeline.layout"),
bind_group_layouts: &[&bind_group_layout],
push_constant_ranges: &[],
immediate_size: 0,
});

let shader =
Expand Down Expand Up @@ -520,7 +521,7 @@ impl DepthPipeline {
compilation_options:
wgpu::PipelineCompilationOptions::default(),
}),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -586,6 +587,7 @@ impl DepthPipeline {
),
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});

pass.set_viewport(
Expand Down
5 changes: 3 additions & 2 deletions examples/integration/src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl Scene {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
})
}

Expand All @@ -64,8 +65,8 @@ fn build_pipeline(
let pipeline_layout =
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: None,
push_constant_ranges: &[],
bind_group_layouts: &[],
immediate_size: 0,
});

device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
Expand Down Expand Up @@ -101,7 +102,7 @@ fn build_pipeline(
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,
cache: None,
})
}
3 changes: 0 additions & 3 deletions wgpu/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ impl<T: bytemuck::Pod> Buffer<T> {
/// Returns the size of the written bytes.
pub fn write(
&mut self,
device: &wgpu::Device,
encoder: &mut wgpu::CommandEncoder,
belt: &mut wgpu::util::StagingBelt,
offset: usize,
Expand All @@ -79,7 +78,6 @@ impl<T: bytemuck::Pod> Buffer<T> {
&self.raw,
(offset + bytes_written) as u64,
MAX_WRITE_SIZE_U64,
device,
)
.copy_from_slice(
&bytes[bytes_written..bytes_written + MAX_WRITE_SIZE],
Expand All @@ -100,7 +98,6 @@ impl<T: bytemuck::Pod> Buffer<T> {
&self.raw,
(offset + bytes_written) as u64,
bytes_left,
device,
)
.copy_from_slice(&bytes[bytes_written..]);

Expand Down
5 changes: 3 additions & 2 deletions wgpu/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn convert(
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("iced_wgpu.offscreen.blit.pipeline_layout"),
bind_group_layouts: &[&constant_layout, &texture_layout],
push_constant_ranges: &[],
immediate_size: 0,
});

let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
Expand Down Expand Up @@ -149,7 +149,7 @@ pub fn convert(
},
depth_stencil: None,
multisample: wgpu::MultisampleState::default(),
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -194,6 +194,7 @@ pub fn convert(
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
});

pass.set_pipeline(&pipeline);
Expand Down
5 changes: 1 addition & 4 deletions wgpu/src/image/atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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, .. } => {
Expand All @@ -145,7 +145,6 @@ impl Atlas {
width,
offset,
&fragment.allocation,
device,
encoder,
belt,
);
Expand Down Expand Up @@ -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,
) {
Expand All @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions wgpu/src/image/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
Expand Down
13 changes: 6 additions & 7 deletions wgpu/src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});

Expand All @@ -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()
});

Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -191,7 +191,7 @@ impl Pipeline {
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down Expand Up @@ -528,7 +528,6 @@ impl Layer {
&self.uniforms,
0,
(bytes.len() as u64).try_into().expect("Sized uniforms"),
device,
)
.copy_from_slice(bytes);

Expand All @@ -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);
}
}

Expand Down
4 changes: 4 additions & 0 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl Renderer {
// It would be great if the `StagingBelt` API exposed methods
// for introspection to detect when a resize may be worth it.
staging_belt: wgpu::util::StagingBelt::new(
engine.device.clone(),
buffer::MAX_WRITE_SIZE as u64,
),

Expand Down Expand Up @@ -454,6 +455,7 @@ impl Renderer {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
},
));

Expand Down Expand Up @@ -528,6 +530,7 @@ impl Renderer {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
},
));
}
Expand Down Expand Up @@ -621,6 +624,7 @@ impl Renderer {
depth_stencil_attachment: None,
timestamp_writes: None,
occlusion_query_set: None,
multiview_mask: None,
},
));
}
Expand Down
4 changes: 1 addition & 3 deletions wgpu/src/quad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl Layer {
transformation: Transformation,
scale: f32,
) {
self.update(device, encoder, belt, transformation, scale);
self.update(encoder, belt, transformation, scale);

if !quads.solids.is_empty() {
self.solid.prepare(device, encoder, belt, &quads.solids);
Expand All @@ -223,7 +223,6 @@ impl Layer {

pub fn update(
&mut self,
device: &wgpu::Device,
encoder: &mut wgpu::CommandEncoder,
belt: &mut wgpu::util::StagingBelt,
transformation: Transformation,
Expand All @@ -237,7 +236,6 @@ impl Layer {
&self.constants_buffer,
0,
(bytes.len() as u64).try_into().expect("Sized uniforms"),
device,
)
.copy_from_slice(bytes);
}
Expand Down
6 changes: 3 additions & 3 deletions wgpu/src/quad/gradient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl Layer {
instances: &[Gradient],
) {
let _ = self.instances.resize(device, instances.len());
let _ = self.instances.write(device, encoder, belt, 0, instances);
let _ = self.instances.write(encoder, belt, 0, instances);

self.instance_count = instances.len();
}
Expand All @@ -75,8 +75,8 @@ impl Pipeline {
let layout = device.create_pipeline_layout(
&wgpu::PipelineLayoutDescriptor {
label: Some("iced_wgpu.quad.gradient.pipeline"),
push_constant_ranges: &[],
bind_group_layouts: &[constants_layout],
immediate_size: 0,
},
);

Expand Down Expand Up @@ -155,7 +155,7 @@ impl Pipeline {
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,
cache: None,
},
);
Expand Down
6 changes: 3 additions & 3 deletions wgpu/src/quad/solid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl Layer {
instances: &[Solid],
) {
let _ = self.instances.resize(device, instances.len());
let _ = self.instances.write(device, encoder, belt, 0, instances);
let _ = self.instances.write(encoder, belt, 0, instances);

self.instance_count = instances.len();
}
Expand All @@ -65,8 +65,8 @@ impl Pipeline {
let layout =
device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
label: Some("iced_wgpu.quad.solid.pipeline"),
push_constant_ranges: &[],
bind_group_layouts: &[constants_layout],
immediate_size: 0,
});

let shader =
Expand Down Expand Up @@ -139,7 +139,7 @@ impl Pipeline {
mask: !0,
alpha_to_coverage_enabled: false,
},
multiview: None,
multiview_mask: None,
cache: None,
});

Expand Down
Loading