summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor <hector@hecrj.dev>2025-03-09 01:57:25 +0100
committerLibravatar GitHub <noreply@github.com>2025-03-09 01:57:25 +0100
commitbae25b74f68078e5ff74cdae717273cf315d4e90 (patch)
tree3760dd8a8c1d3bafaadefd3e07c7c70820e8d582
parent86e8494bfa460bdbf506695f8f4b4f01a9cf5088 (diff)
parentfb2544021a40d029a99cadda7cf59acf5e7dc455 (diff)
downloadiced-bae25b74f68078e5ff74cdae717273cf315d4e90.tar.gz
iced-bae25b74f68078e5ff74cdae717273cf315d4e90.tar.bz2
iced-bae25b74f68078e5ff74cdae717273cf315d4e90.zip
Merge pull request #2832 from codewing/feature/wgpu-24
Update `wgpu` to `24` and use `cryoglyph` fork
-rw-r--r--Cargo.lock118
-rw-r--r--Cargo.toml4
-rw-r--r--benches/wgpu.rs2
-rw-r--r--examples/integration/src/main.rs5
-rw-r--r--graphics/src/compositor.rs3
-rw-r--r--wgpu/Cargo.toml2
-rw-r--r--wgpu/src/image/atlas.rs10
-rw-r--r--wgpu/src/text.rs56
-rw-r--r--wgpu/src/window/compositor.rs16
9 files changed, 126 insertions, 90 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 25fe2b77..2ad1bd35 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -620,6 +620,9 @@ name = "bitflags"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
+dependencies = [
+ "serde",
+]
[[package]]
name = "bitstream-io"
@@ -809,12 +812,6 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cfg_aliases"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
-
-[[package]]
-name = "cfg_aliases"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
@@ -1215,6 +1212,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
[[package]]
+name = "cryoglyph"
+version = "0.1.0"
+source = "git+https://github.com/iced-rs/cryoglyph.git?rev=a886f2427e612b23788a4e36658ff8cd55ba6695#a886f2427e612b23788a4e36658ff8cd55ba6695"
+dependencies = [
+ "cosmic-text",
+ "etagere",
+ "lru",
+ "rustc-hash 2.1.1",
+ "wgpu",
+]
+
+[[package]]
name = "crypto-common"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2054,9 +2063,9 @@ dependencies = [
[[package]]
name = "glow"
-version = "0.14.2"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51fa363f025f5c111e03f13eda21162faeacb6911fe8caa0c0349f9cf0c4483"
+checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08"
dependencies = [
"js-sys",
"slotmap",
@@ -2074,18 +2083,6 @@ dependencies = [
]
[[package]]
-name = "glyphon"
-version = "0.5.0"
-source = "git+https://github.com/hecrj/glyphon.git?rev=09712a70df7431e9a3b1ac1bbd4fb634096cb3b4#09712a70df7431e9a3b1ac1bbd4fb634096cb3b4"
-dependencies = [
- "cosmic-text",
- "etagere",
- "lru",
- "rustc-hash 2.1.1",
- "wgpu",
-]
-
-[[package]]
name = "gobject-sys"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2635,9 +2632,9 @@ version = "0.14.0-dev"
dependencies = [
"bitflags 2.9.0",
"bytemuck",
+ "cryoglyph",
"futures",
"glam",
- "glyphon",
"guillotiere",
"iced_graphics",
"log",
@@ -3371,9 +3368,9 @@ dependencies = [
[[package]]
name = "metal"
-version = "0.29.0"
+version = "0.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21"
+checksum = "f569fb946490b5743ad69813cb19629130ce9374034abe31614a36402d18f99e"
dependencies = [
"bitflags 2.9.0",
"block",
@@ -3476,22 +3473,23 @@ checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b"
[[package]]
name = "naga"
-version = "23.1.0"
+version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "364f94bc34f61332abebe8cad6f6cd82a5b65cff22c828d05d0968911462ca4f"
+checksum = "e380993072e52eef724eddfcde0ed013b0c023c3f0417336ed041aa9f076994e"
dependencies = [
"arrayvec",
"bit-set",
"bitflags 2.9.0",
- "cfg_aliases 0.1.1",
+ "cfg_aliases",
"codespan-reporting",
"hexf-parse",
"indexmap",
"log",
"rustc-hash 1.1.0",
"spirv",
+ "strum",
"termcolor",
- "thiserror 1.0.69",
+ "thiserror 2.0.12",
"unicode-xid",
]
@@ -3565,7 +3563,7 @@ checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
dependencies = [
"bitflags 2.9.0",
"cfg-if",
- "cfg_aliases 0.2.1",
+ "cfg_aliases",
"libc",
"memoffset",
]
@@ -4039,6 +4037,15 @@ dependencies = [
]
[[package]]
+name = "ordered-float"
+version = "4.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
name = "ordered-stream"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -5390,7 +5397,7 @@ checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08"
dependencies = [
"as-raw-xcb-connection",
"bytemuck",
- "cfg_aliases 0.2.1",
+ "cfg_aliases",
"core-graphics 0.24.0",
"drm",
"fastrand 2.3.0",
@@ -5467,6 +5474,28 @@ dependencies = [
]
[[package]]
+name = "strum"
+version = "0.26.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06"
+dependencies = [
+ "strum_macros",
+]
+
+[[package]]
+name = "strum_macros"
+version = "0.26.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
+dependencies = [
+ "heck 0.5.0",
+ "proc-macro2",
+ "quote",
+ "rustversion",
+ "syn",
+]
+
+[[package]]
name = "styling"
version = "0.1.0"
dependencies = [
@@ -6688,12 +6717,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082"
[[package]]
name = "wgpu"
-version = "23.0.1"
+version = "24.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80f70000db37c469ea9d67defdc13024ddf9a5f1b89cb2941b812ad7cde1735a"
+checksum = "47f55718f85c2fa756edffa0e7f0e0a60aba463d1362b57e23123c58f035e4b6"
dependencies = [
"arrayvec",
- "cfg_aliases 0.1.1",
+ "bitflags 2.9.0",
+ "cfg_aliases",
"document-features",
"js-sys",
"log",
@@ -6713,14 +6743,14 @@ dependencies = [
[[package]]
name = "wgpu-core"
-version = "23.0.1"
+version = "24.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d63c3c478de8e7e01786479919c8769f62a22eec16788d8c2ac77ce2c132778a"
+checksum = "671c25545d479b47d3f0a8e373aceb2060b67c6eb841b24ac8c32348151c7a0c"
dependencies = [
"arrayvec",
"bit-vec",
"bitflags 2.9.0",
- "cfg_aliases 0.1.1",
+ "cfg_aliases",
"document-features",
"indexmap",
"log",
@@ -6731,16 +6761,16 @@ dependencies = [
"raw-window-handle 0.6.2",
"rustc-hash 1.1.0",
"smallvec",
- "thiserror 1.0.69",
+ "thiserror 2.0.12",
"wgpu-hal",
"wgpu-types",
]
[[package]]
name = "wgpu-hal"
-version = "23.0.1"
+version = "24.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89364b8a0b211adc7b16aeaf1bd5ad4a919c1154b44c9ce27838213ba05fd821"
+checksum = "4317a17171dc20e6577bf606796794580accae0716a69edbc7388c86a3ec9f23"
dependencies = [
"android_system_properties",
"arrayvec",
@@ -6749,7 +6779,7 @@ dependencies = [
"bitflags 2.9.0",
"block",
"bytemuck",
- "cfg_aliases 0.1.1",
+ "cfg_aliases",
"core-graphics-types 0.1.3",
"glow",
"glutin_wgl_sys",
@@ -6766,6 +6796,7 @@ dependencies = [
"ndk-sys 0.5.0+25.2.9519653",
"objc",
"once_cell",
+ "ordered-float",
"parking_lot",
"profiling",
"range-alloc",
@@ -6773,7 +6804,7 @@ dependencies = [
"renderdoc-sys",
"rustc-hash 1.1.0",
"smallvec",
- "thiserror 1.0.69",
+ "thiserror 2.0.12",
"wasm-bindgen",
"web-sys",
"wgpu-types",
@@ -6783,12 +6814,13 @@ dependencies = [
[[package]]
name = "wgpu-types"
-version = "23.0.0"
+version = "24.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "610f6ff27778148c31093f3b03abc4840f9636d58d597ca2f5977433acfe0068"
+checksum = "50ac044c0e76c03a0378e7786ac505d010a873665e2d51383dcff8dd227dc69c"
dependencies = [
"bitflags 2.9.0",
"js-sys",
+ "log",
"web-sys",
]
@@ -7206,7 +7238,7 @@ dependencies = [
"block2",
"bytemuck",
"calloop",
- "cfg_aliases 0.2.1",
+ "cfg_aliases",
"concurrent-queue",
"core-foundation 0.9.4",
"core-graphics 0.23.2",
diff --git a/Cargo.toml b/Cargo.toml
index f1e9babf..47fe83b0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -152,7 +152,7 @@ cosmic-text = "0.12"
dark-light = "2.0"
futures = "0.3"
glam = "0.25"
-glyphon = { git = "https://github.com/hecrj/glyphon.git", rev = "09712a70df7431e9a3b1ac1bbd4fb634096cb3b4" }
+cryoglyph = { git = "https://github.com/iced-rs/cryoglyph.git", rev = "a886f2427e612b23788a4e36658ff8cd55ba6695" }
guillotiere = "0.6"
half = "2.2"
image = { version = "0.25", default-features = false }
@@ -188,7 +188,7 @@ wasm-bindgen-futures = "0.4"
wasmtimer = "0.4.1"
web-sys = "0.3.69"
web-time = "1.1"
-wgpu = "23.0"
+wgpu = "24.0"
window_clipboard = "0.4.1"
winit = { git = "https://github.com/iced-rs/winit.git", rev = "11414b6aa45699f038114e61b4ddf5102b2d3b4b" }
diff --git a/benches/wgpu.rs b/benches/wgpu.rs
index 033eb46d..c920a71e 100644
--- a/benches/wgpu.rs
+++ b/benches/wgpu.rs
@@ -18,7 +18,7 @@ pub fn wgpu_benchmark(c: &mut Criterion) {
use iced_futures::futures::executor;
use iced_wgpu::wgpu;
- let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
+ let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends: wgpu::Backends::all(),
..Default::default()
});
diff --git a/examples/integration/src/main.rs b/examples/integration/src/main.rs
index 386e0f70..7c5388ab 100644
--- a/examples/integration/src/main.rs
+++ b/examples/integration/src/main.rs
@@ -70,10 +70,9 @@ pub fn main() -> Result<(), winit::error::EventLoopError> {
);
let clipboard = Clipboard::connect(window.clone());
- let backend =
- wgpu::util::backend_bits_from_env().unwrap_or_default();
+ let backend = wgpu::Backends::from_env().unwrap_or_default();
- let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
+ let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends: backend,
..Default::default()
});
diff --git a/graphics/src/compositor.rs b/graphics/src/compositor.rs
index df3d41c3..363d651d 100644
--- a/graphics/src/compositor.rs
+++ b/graphics/src/compositor.rs
@@ -132,6 +132,9 @@ pub enum SurfaceError {
/// There is no more memory left to allocate a new frame.
#[error("There is no more memory left to allocate a new frame")]
OutOfMemory,
+ /// Acquiring a texture failed with a generic error.
+ #[error("Acquiring a texture failed with a generic error")]
+ Other,
}
/// Contains information about the graphics (e.g. graphics adapter, graphics backend).
diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml
index 4b6b0483..50c9f588 100644
--- a/wgpu/Cargo.toml
+++ b/wgpu/Cargo.toml
@@ -32,7 +32,7 @@ bitflags.workspace = true
bytemuck.workspace = true
futures.workspace = true
glam.workspace = true
-glyphon.workspace = true
+cryoglyph.workspace = true
guillotiere.workspace = true
log.workspace = true
rustc-hash.workspace = true
diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs
index a1ec0d7b..3cede8b6 100644
--- a/wgpu/src/image/atlas.rs
+++ b/wgpu/src/image/atlas.rs
@@ -344,15 +344,15 @@ impl Atlas {
});
encoder.copy_buffer_to_texture(
- wgpu::ImageCopyBuffer {
+ wgpu::TexelCopyBufferInfo {
buffer: &buffer,
- layout: wgpu::ImageDataLayout {
+ layout: wgpu::TexelCopyBufferLayout {
offset: offset as u64,
bytes_per_row: Some(4 * image_width + padding),
rows_per_image: Some(image_height),
},
},
- wgpu::ImageCopyTexture {
+ wgpu::TexelCopyTextureInfo {
texture: &self.texture,
mip_level: 0,
origin: wgpu::Origin3d {
@@ -407,7 +407,7 @@ impl Atlas {
}
encoder.copy_texture_to_texture(
- wgpu::ImageCopyTexture {
+ wgpu::TexelCopyTextureInfo {
texture: &self.texture,
mip_level: 0,
origin: wgpu::Origin3d {
@@ -417,7 +417,7 @@ impl Atlas {
},
aspect: wgpu::TextureAspect::default(),
},
- wgpu::ImageCopyTexture {
+ wgpu::TexelCopyTextureInfo {
texture: &new_texture,
mip_level: 0,
origin: wgpu::Origin3d {
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index 33fbd4dc..274cc4b7 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -12,10 +12,10 @@ use std::sync::{self, Arc};
pub use crate::graphics::Text;
-const COLOR_MODE: glyphon::ColorMode = if color::GAMMA_CORRECTION {
- glyphon::ColorMode::Accurate
+const COLOR_MODE: cryoglyph::ColorMode = if color::GAMMA_CORRECTION {
+ cryoglyph::ColorMode::Accurate
} else {
- glyphon::ColorMode::Web
+ cryoglyph::ColorMode::Web
};
pub type Batch = Vec<Item>;
@@ -70,7 +70,7 @@ impl Cache {
}
struct Upload {
- renderer: glyphon::TextRenderer,
+ renderer: cryoglyph::TextRenderer,
buffer_cache: BufferCache,
transformation: Transformation,
version: usize,
@@ -86,7 +86,7 @@ pub struct Storage {
}
struct Group {
- atlas: glyphon::TextAtlas,
+ atlas: cryoglyph::TextAtlas,
version: usize,
should_trim: bool,
handle: Arc<()>, // Keeps track of active uploads
@@ -97,7 +97,7 @@ impl Storage {
Self::default()
}
- fn get(&self, cache: &Cache) -> Option<(&glyphon::TextAtlas, &Upload)> {
+ fn get(&self, cache: &Cache) -> Option<(&cryoglyph::TextAtlas, &Upload)> {
if cache.text.is_empty() {
return None;
}
@@ -112,10 +112,10 @@ impl Storage {
&mut self,
device: &wgpu::Device,
queue: &wgpu::Queue,
- viewport: &glyphon::Viewport,
+ viewport: &cryoglyph::Viewport,
encoder: &mut wgpu::CommandEncoder,
format: wgpu::TextureFormat,
- state: &glyphon::Cache,
+ state: &cryoglyph::Cache,
cache: &Cache,
new_transformation: Transformation,
bounds: Rectangle,
@@ -130,7 +130,7 @@ impl Storage {
);
Group {
- atlas: glyphon::TextAtlas::with_color_mode(
+ atlas: cryoglyph::TextAtlas::with_color_mode(
device, queue, state, format, COLOR_MODE,
),
version: 0,
@@ -175,7 +175,7 @@ impl Storage {
}
}
hash_map::Entry::Vacant(entry) => {
- let mut renderer = glyphon::TextRenderer::new(
+ let mut renderer = cryoglyph::TextRenderer::new(
&mut group.atlas,
device,
wgpu::MultisampleState::default(),
@@ -257,13 +257,13 @@ impl Storage {
}
}
-pub struct Viewport(glyphon::Viewport);
+pub struct Viewport(cryoglyph::Viewport);
impl Viewport {
pub fn update(&mut self, queue: &wgpu::Queue, resolution: Size<u32>) {
self.0.update(
queue,
- glyphon::Resolution {
+ cryoglyph::Resolution {
width: resolution.width,
height: resolution.height,
},
@@ -273,10 +273,10 @@ impl Viewport {
#[allow(missing_debug_implementations)]
pub struct Pipeline {
- state: glyphon::Cache,
+ state: cryoglyph::Cache,
format: wgpu::TextureFormat,
- atlas: glyphon::TextAtlas,
- renderers: Vec<glyphon::TextRenderer>,
+ atlas: cryoglyph::TextAtlas,
+ renderers: Vec<cryoglyph::TextRenderer>,
prepare_layer: usize,
cache: BufferCache,
}
@@ -287,8 +287,8 @@ impl Pipeline {
queue: &wgpu::Queue,
format: wgpu::TextureFormat,
) -> Self {
- let state = glyphon::Cache::new(device);
- let atlas = glyphon::TextAtlas::with_color_mode(
+ let state = cryoglyph::Cache::new(device);
+ let atlas = cryoglyph::TextAtlas::with_color_mode(
device, queue, &state, format, COLOR_MODE,
);
@@ -320,7 +320,7 @@ impl Pipeline {
text,
} => {
if self.renderers.len() <= self.prepare_layer {
- self.renderers.push(glyphon::TextRenderer::new(
+ self.renderers.push(cryoglyph::TextRenderer::new(
&mut self.atlas,
device,
wgpu::MultisampleState::default(),
@@ -346,7 +346,7 @@ impl Pipeline {
Ok(()) => {
self.prepare_layer += 1;
}
- Err(glyphon::PrepareError::AtlasFull) => {
+ Err(cryoglyph::PrepareError::AtlasFull) => {
// If the atlas cannot grow, then all bets are off.
// Instead of panicking, we will just pray that the result
// will be somewhat readable...
@@ -417,7 +417,7 @@ impl Pipeline {
}
pub fn create_viewport(&self, device: &wgpu::Device) -> Viewport {
- Viewport(glyphon::Viewport::new(device, &self.state))
+ Viewport(cryoglyph::Viewport::new(device, &self.state))
}
pub fn end_frame(&mut self) {
@@ -431,15 +431,15 @@ impl Pipeline {
fn prepare(
device: &wgpu::Device,
queue: &wgpu::Queue,
- viewport: &glyphon::Viewport,
+ viewport: &cryoglyph::Viewport,
encoder: &mut wgpu::CommandEncoder,
- renderer: &mut glyphon::TextRenderer,
- atlas: &mut glyphon::TextAtlas,
+ renderer: &mut cryoglyph::TextRenderer,
+ atlas: &mut cryoglyph::TextAtlas,
buffer_cache: &mut BufferCache,
sections: &[Text],
layer_bounds: Rectangle,
layer_transformation: Transformation,
-) -> Result<(), glyphon::PrepareError> {
+) -> Result<(), cryoglyph::PrepareError> {
let mut font_system = font_system().write().expect("Write font system");
let font_system = font_system.raw();
@@ -447,7 +447,7 @@ fn prepare(
Paragraph(Paragraph),
Editor(Editor),
Cache(text_cache::KeyHash),
- Raw(Arc<glyphon::Buffer>),
+ Raw(Arc<cryoglyph::Buffer>),
}
let allocations: Vec<_> = sections
@@ -618,13 +618,13 @@ fn prepare(
&(clip_bounds * transformation * layer_transformation),
)?;
- Some(glyphon::TextArea {
+ Some(cryoglyph::TextArea {
buffer,
left,
top,
scale: transformation.scale_factor()
* layer_transformation.scale_factor(),
- bounds: glyphon::TextBounds {
+ bounds: cryoglyph::TextBounds {
left: clip_bounds.x as i32,
top: clip_bounds.y as i32,
right: (clip_bounds.x + clip_bounds.width) as i32,
@@ -643,6 +643,6 @@ fn prepare(
atlas,
viewport,
text_areas,
- &mut glyphon::SwashCache::new(),
+ &mut cryoglyph::SwashCache::new(),
)
}
diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs
index 4fe689cf..bc932b44 100644
--- a/wgpu/src/window/compositor.rs
+++ b/wgpu/src/window/compositor.rs
@@ -54,7 +54,7 @@ impl Compositor {
settings: Settings,
compatible_window: Option<W>,
) -> Result<Self, Error> {
- let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
+ let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor {
backends: settings.backends,
flags: if cfg!(feature = "strict-assertions") {
wgpu::InstanceFlags::debugging()
@@ -81,12 +81,13 @@ impl Compositor {
.and_then(|window| instance.create_surface(window).ok());
let adapter_options = wgpu::RequestAdapterOptions {
- power_preference: wgpu::util::power_preference_from_env()
- .unwrap_or(if settings.antialiasing.is_none() {
+ power_preference: wgpu::PowerPreference::from_env().unwrap_or(
+ if settings.antialiasing.is_none() {
wgpu::PowerPreference::LowPower
} else {
wgpu::PowerPreference::HighPerformance
- }),
+ },
+ ),
compatible_surface: compatible_surface.as_ref(),
force_fallback_adapter: false,
};
@@ -263,6 +264,7 @@ pub fn present<T: AsRef<str>>(
wgpu::SurfaceError::OutOfMemory => {
Err(compositor::SurfaceError::OutOfMemory)
}
+ wgpu::SurfaceError::Other => Err(compositor::SurfaceError::Other),
},
}
}
@@ -280,7 +282,7 @@ impl graphics::Compositor for Compositor {
None | Some("wgpu") => {
let mut settings = Settings::from(settings);
- if let Some(backends) = wgpu::util::backend_bits_from_env() {
+ if let Some(backends) = wgpu::Backends::from_env() {
settings.backends = backends;
}
@@ -451,9 +453,9 @@ pub fn screenshot<T: AsRef<str>>(
encoder.copy_texture_to_buffer(
texture.as_image_copy(),
- wgpu::ImageCopyBuffer {
+ wgpu::TexelCopyBufferInfo {
buffer: &output_buffer,
- layout: wgpu::ImageDataLayout {
+ layout: wgpu::TexelCopyBufferLayout {
offset: 0,
bytes_per_row: Some(dimensions.padded_bytes_per_row as u32),
rows_per_image: None,