Merge branch 'master' into advanced-text

This commit is contained in:
Héctor Ramón Jiménez 2023-04-17 23:41:12 +02:00
commit 4bae457c37
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
73 changed files with 1586 additions and 703 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "iced_wgpu"
version = "0.9.0"
version = "0.10.0"
authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
edition = "2021"
description = "A wgpu renderer for Iced"
@ -38,7 +38,7 @@ version = "1.9"
features = ["derive"]
[dependencies.iced_graphics]
version = "0.7"
version = "0.8"
path = "../graphics"
[dependencies.glyphon]

View file

@ -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

View file

@ -205,7 +205,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"),
)),

View file

@ -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

View file

@ -48,7 +48,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"),
)),

View file

@ -577,7 +577,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!(

View file

@ -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"),
)),

View file

@ -66,7 +66,19 @@ impl<Theme> Compositor<Theme> {
log::info!("Selected: {:#?}", adapter.get_info());
let format = compatible_surface.as_ref().and_then(|surface| {
surface.get_capabilities(&adapter).formats.first().copied()
let capabilities = surface.get_capabilities(&adapter);
capabilities
.formats
.iter()
.filter(|format| format.describe().srgb)
.copied()
.next()
.or_else(|| {
log::warn!("No sRGB format found!");
capabilities.formats.first().copied()
})
})?;
log::info!("Selected format: {:?}", format);