From 703484c5fdd87c64a41d3e627b0c79b43179e124 Mon Sep 17 00:00:00 2001 From: David Huculak Date: Sat, 1 Apr 2023 16:10:28 -0400 Subject: remove colons from shader labels --- wgpu/src/image.rs | 2 +- wgpu/src/quad.rs | 2 +- wgpu/src/triangle.rs | 4 ++-- wgpu/src/triangle/msaa.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'wgpu') diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index a5e63b17..9f56c188 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -141,7 +141,7 @@ impl Pipeline { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { - label: Some("iced_wgpu::image::shader"), + label: Some("iced_wgpu image shader"), source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed( include_str!("shader/image.wgsl"), )), diff --git a/wgpu/src/quad.rs b/wgpu/src/quad.rs index 2f5fcc6b..1343181e 100644 --- a/wgpu/src/quad.rs +++ b/wgpu/src/quad.rs @@ -63,7 +63,7 @@ impl Pipeline { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { - label: Some("iced_wgpu::quad::shader"), + label: Some("iced_wgpu quad shader"), source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed( include_str!("shader/quad.wgsl"), )), diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index efdd214b..162428f0 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -457,7 +457,7 @@ mod solid { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some( - "iced_wgpu::triangle::solid create shader module", + "iced_wgpu triangle solid create shader module", ), source: wgpu::ShaderSource::Wgsl( std::borrow::Cow::Borrowed(include_str!( @@ -654,7 +654,7 @@ mod gradient { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some( - "iced_wgpu::triangle::gradient create shader module", + "iced_wgpu triangle gradient create shader module", ), source: wgpu::ShaderSource::Wgsl( std::borrow::Cow::Borrowed(include_str!( diff --git a/wgpu/src/triangle/msaa.rs b/wgpu/src/triangle/msaa.rs index a3016ff8..e76f7d5e 100644 --- a/wgpu/src/triangle/msaa.rs +++ b/wgpu/src/triangle/msaa.rs @@ -75,7 +75,7 @@ impl Blit { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { - label: Some("iced_wgpu::triangle::blit_shader"), + label: Some("iced_wgpu triangle blit_shader"), source: wgpu::ShaderSource::Wgsl(std::borrow::Cow::Borrowed( include_str!("../shader/blit.wgsl"), )), -- cgit From d5453c62e9bdbf0cea030b009c41b892b700496d Mon Sep 17 00:00:00 2001 From: Elham Aryanpur Date: Wed, 12 Apr 2023 23:38:21 +0300 Subject: Update `wgpu` to `0.15` --- wgpu/Cargo.toml | 4 ++-- wgpu/src/image/atlas.rs | 2 ++ wgpu/src/triangle/msaa.rs | 2 ++ wgpu/src/window/compositor.rs | 25 +++++++++++++++++++++---- 4 files changed, 27 insertions(+), 6 deletions(-) (limited to 'wgpu') diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index f1e22cf6..4dcd07f7 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -28,8 +28,8 @@ spirv = ["wgpu/spirv"] webgl = ["wgpu/webgl"] [dependencies] -wgpu = "0.14" -wgpu_glyph = "0.18" +wgpu = "0.15" +wgpu_glyph = "0.19" glyph_brush = "0.7" raw-window-handle = "0.5" log = "0.4" diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs index eafe2f96..82504147 100644 --- a/wgpu/src/image/atlas.rs +++ b/wgpu/src/image/atlas.rs @@ -39,6 +39,7 @@ impl Atlas { sample_count: 1, dimension: wgpu::TextureDimension::D2, format: wgpu::TextureFormat::Rgba8UnormSrgb, + view_formats: &[], usage: wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::COPY_SRC | wgpu::TextureUsages::TEXTURE_BINDING, @@ -247,6 +248,7 @@ impl Atlas { sample_count: 1, dimension: wgpu::TextureDimension::D2, format: wgpu::TextureFormat::Rgba8UnormSrgb, + view_formats: &[], usage: wgpu::TextureUsages::COPY_DST | wgpu::TextureUsages::COPY_SRC | wgpu::TextureUsages::TEXTURE_BINDING, diff --git a/wgpu/src/triangle/msaa.rs b/wgpu/src/triangle/msaa.rs index e76f7d5e..d24f8e1a 100644 --- a/wgpu/src/triangle/msaa.rs +++ b/wgpu/src/triangle/msaa.rs @@ -222,6 +222,7 @@ impl Targets { sample_count, dimension: wgpu::TextureDimension::D2, format, + view_formats: &[], usage: wgpu::TextureUsages::RENDER_ATTACHMENT, }); @@ -232,6 +233,7 @@ impl Targets { sample_count: 1, dimension: wgpu::TextureDimension::D2, format, + view_formats: &[], usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::TEXTURE_BINDING, }); diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 6d0c36f6..d66aca71 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -31,7 +31,10 @@ impl Compositor { settings: Settings, compatible_window: Option<&W>, ) -> Option { - 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 Compositor { #[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,18 @@ impl Compositor { 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 + .iter() + .filter(|format| format.describe().srgb) + .copied() + .next() + .or_else(|| { + log::warn!("No sRGB format found!"); + + surface.get_capabilities(&adapter).formats.first().copied() + }) })?; log::info!("Selected format: {:?}", format); @@ -144,7 +158,9 @@ impl iced_graphics::window::Compositor for Compositor { ) -> wgpu::Surface { #[allow(unsafe_code)] unsafe { - self.instance.create_surface(window) + self.instance + .create_surface(window) + .expect("Create surface") } } @@ -163,6 +179,7 @@ impl iced_graphics::window::Compositor for Compositor { width, height, alpha_mode: wgpu::CompositeAlphaMode::Auto, + view_formats: vec![], }, ); } -- cgit From b677345ac1b1d087bc7f331c9c8c5be06933ba6e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 13 Apr 2023 05:42:56 +0200 Subject: Get surface capabilities only once in `iced_wgpu` --- wgpu/src/window/compositor.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'wgpu') diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index d66aca71..d4a59471 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -66,8 +66,9 @@ impl Compositor { log::info!("Selected: {:#?}", adapter.get_info()); let format = compatible_surface.as_ref().and_then(|surface| { - surface - .get_capabilities(&adapter) + let capabilities = surface.get_capabilities(&adapter); + + capabilities .formats .iter() .filter(|format| format.describe().srgb) @@ -76,7 +77,7 @@ impl Compositor { .or_else(|| { log::warn!("No sRGB format found!"); - surface.get_capabilities(&adapter).formats.first().copied() + capabilities.formats.first().copied() }) })?; -- cgit From c79cc2d2b3df99f69b048c68e503916c779a1102 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 13 Apr 2023 08:31:17 +0200 Subject: Bump versions :tada: --- wgpu/Cargo.toml | 6 +++--- wgpu/README.md | 2 +- wgpu/src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'wgpu') diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 4dcd07f7..3478ef59 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iced_wgpu" -version = "0.9.0" +version = "0.10.0" authors = ["Héctor Ramón Jiménez "] edition = "2021" description = "A wgpu renderer for Iced" @@ -42,11 +42,11 @@ version = "1.9" features = ["derive"] [dependencies.iced_native] -version = "0.9" +version = "0.10" path = "../native" [dependencies.iced_graphics] -version = "0.7" +version = "0.8" path = "../graphics" features = ["font-fallback", "font-icons"] diff --git a/wgpu/README.md b/wgpu/README.md index 3e6af103..f8c88374 100644 --- a/wgpu/README.md +++ b/wgpu/README.md @@ -30,7 +30,7 @@ Currently, `iced_wgpu` supports the following primitives: Add `iced_wgpu` as a dependency in your `Cargo.toml`: ```toml -iced_wgpu = "0.9" +iced_wgpu = "0.10" ``` __Iced moves fast and the `master` branch can contain breaking changes!__ If diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 1a293681..969e3199 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -16,7 +16,7 @@ //! - Meshes of triangles, useful to draw geometry freely. //! //! [Iced]: https://github.com/iced-rs/iced -//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.8/native +//! [`iced_native`]: https://github.com/iced-rs/iced/tree/0.9/native //! [`wgpu`]: https://github.com/gfx-rs/wgpu-rs //! [WebGPU API]: https://gpuweb.github.io/gpuweb/ //! [`wgpu_glyph`]: https://github.com/hecrj/wgpu_glyph -- cgit From e3730106e9d4f75de199e1b83cf285b8ff031968 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 17 Apr 2023 23:44:26 +0200 Subject: Update `glyphon` to latest `dev` --- wgpu/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wgpu') diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 4559040e..14dcd550 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -44,7 +44,7 @@ path = "../graphics" [dependencies.glyphon] version = "0.2" git = "https://github.com/hecrj/glyphon.git" -rev = "6601deec1c7595f8fd5f83f929b2497104905400" +rev = "1d26d92b19407c5dabe4625944d4a6babbbf0715" [dependencies.encase] version = "0.3.0" -- cgit