diff options
author | 2023-04-08 04:47:05 +0200 | |
---|---|---|
committer | 2023-04-08 04:47:05 +0200 | |
commit | c0431aedd3bbef4161456f2fa5f29866e8f17fc5 (patch) | |
tree | 37f5af689b91818e04f3bc58e523aa24858f056a /wgpu | |
parent | 6fae8bf6cbe7155bcee42eaeba68e31564df057c (diff) | |
download | iced-c0431aedd3bbef4161456f2fa5f29866e8f17fc5.tar.gz iced-c0431aedd3bbef4161456f2fa5f29866e8f17fc5.tar.bz2 iced-c0431aedd3bbef4161456f2fa5f29866e8f17fc5.zip |
Update `wgpu` and `cosmic-text`
Diffstat (limited to '')
-rw-r--r-- | wgpu/Cargo.toml | 4 | ||||
-rw-r--r-- | wgpu/src/image/atlas.rs | 2 | ||||
-rw-r--r-- | wgpu/src/text.rs | 17 | ||||
-rw-r--r-- | wgpu/src/triangle/msaa.rs | 2 | ||||
-rw-r--r-- | wgpu/src/window/compositor.rs | 13 |
5 files changed, 22 insertions, 16 deletions
diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 3aef4ff4..36c891bb 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -13,7 +13,7 @@ image = ["iced_graphics/image"] svg = ["resvg"] [dependencies] -wgpu = "0.14" +wgpu = "0.15" raw-window-handle = "0.5" log = "0.4" guillotiere = "0.6" @@ -44,7 +44,7 @@ path = "../graphics" [dependencies.glyphon] version = "0.2" git = "https://github.com/hecrj/glyphon.git" -rev = "47050174841a4f58fc8d85c943a2117f72f19e8e" +rev = "6601deec1c7595f8fd5f83f929b2497104905400" [dependencies.encase] version = "0.3.0" diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs index c00b8cef..39b6e5d2 100644 --- a/wgpu/src/image/atlas.rs +++ b/wgpu/src/image/atlas.rs @@ -41,6 +41,7 @@ impl Atlas { usage: wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::COPY_SRC | wgpu::TextureUsages::TEXTURE_BINDING, + view_formats: &[], }); let texture_view = texture.create_view(&wgpu::TextureViewDescriptor { @@ -338,6 +339,7 @@ impl Atlas { usage: wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::COPY_SRC | wgpu::TextureUsages::TEXTURE_BINDING, + view_formats: &[], }); let amount_to_copy = self.layers.len() - amount; diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index dd674279..f01e0b42 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -58,8 +58,12 @@ impl Pipeline { target_size: Size<u32>, ) -> bool { if self.renderers.len() <= self.prepare_layer { - self.renderers - .push(glyphon::TextRenderer::new(device, queue)); + self.renderers.push(glyphon::TextRenderer::new( + &mut self.atlas, + device, + Default::default(), + None, + )); } let font_system = self.font_system.get_mut(); @@ -359,14 +363,7 @@ impl Cache { glyphon::Attrs::new() .family(to_family(key.font.family)) .weight(to_weight(key.font.weight)) - .stretch(to_stretch(key.font.stretch)) - .monospaced( - key.font.monospaced - || matches!( - key.font.family, - font::Family::Monospace - ), - ), + .stretch(to_stretch(key.font.stretch)), ); let _ = entry.insert(buffer); diff --git a/wgpu/src/triangle/msaa.rs b/wgpu/src/triangle/msaa.rs index 7144125c..14522c89 100644 --- a/wgpu/src/triangle/msaa.rs +++ b/wgpu/src/triangle/msaa.rs @@ -223,6 +223,7 @@ impl Targets { dimension: wgpu::TextureDimension::D2, format, usage: wgpu::TextureUsages::RENDER_ATTACHMENT, + view_formats: &[], }); let resolve = device.create_texture(&wgpu::TextureDescriptor { @@ -234,6 +235,7 @@ impl Targets { format, usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING, + view_formats: &[], }); let attachment = diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index a67ac3c0..025cd43a 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -31,7 +31,10 @@ impl<Theme> Compositor<Theme> { settings: Settings, compatible_window: Option<&W>, ) -> Option<Self> { - let instance = wgpu::Instance::new(settings.internal_backend); + let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + backends: settings.internal_backend, + ..Default::default() + }); log::info!("{:#?}", settings); @@ -46,7 +49,7 @@ impl<Theme> Compositor<Theme> { #[allow(unsafe_code)] let compatible_surface = compatible_window - .map(|window| unsafe { instance.create_surface(window) }); + .and_then(|window| unsafe { instance.create_surface(window).ok() }); let adapter = instance .request_adapter(&wgpu::RequestAdapterOptions { @@ -63,7 +66,7 @@ impl<Theme> Compositor<Theme> { log::info!("Selected: {:#?}", adapter.get_info()); let format = compatible_surface.as_ref().and_then(|surface| { - surface.get_supported_formats(&adapter).first().copied() + surface.get_capabilities(&adapter).formats.first().copied() })?; log::info!("Selected format: {:?}", format); @@ -207,7 +210,8 @@ impl<Theme> graphics::Compositor for Compositor<Theme> { height: u32, ) -> wgpu::Surface { #[allow(unsafe_code)] - let mut surface = unsafe { self.instance.create_surface(window) }; + let mut surface = unsafe { self.instance.create_surface(window) } + .expect("Create surface"); self.configure_surface(&mut surface, width, height); @@ -229,6 +233,7 @@ impl<Theme> graphics::Compositor for Compositor<Theme> { width, height, alpha_mode: wgpu::CompositeAlphaMode::Auto, + view_formats: vec![], }, ); } |