Skip to content

Commit 8ed0fd3

Browse files
committed
wgpu: Switch to WGPU 26
1 parent ebe4783 commit 8ed0fd3

File tree

29 files changed

+174
-166
lines changed

29 files changed

+174
-166
lines changed

.github/workflows/build_docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up crate rustdoc link
3636
run: |
3737
rgb_version=`grep 'rgb = ' internal/core/Cargo.toml | sed 's/^.*"\(.*\)"/\1/'`
38-
echo "RUSTDOCFLAGS=$RUSTDOCFLAGS --extern-html-root-url rgb=https://docs.rs/rgb/$rgb_version/ --extern-html-root-url android_activity=https://docs.rs/android-activity/0.5/ --extern-html-root-url raw_window_handle=https://docs.rs/raw_window_handle/0.6 --extern-html-root-url winit=https://docs.rs/winit/0.30 --extern-html-root-url wgpu=https://docs.rs/wgpu/25" >> $GITHUB_ENV
38+
echo "RUSTDOCFLAGS=$RUSTDOCFLAGS --extern-html-root-url rgb=https://docs.rs/rgb/$rgb_version/ --extern-html-root-url android_activity=https://docs.rs/android-activity/0.5/ --extern-html-root-url raw_window_handle=https://docs.rs/raw_window_handle/0.6 --extern-html-root-url winit=https://docs.rs/winit/0.30 --extern-html-root-url wgpu=https://docs.rs/wgpu/26" >> $GITHUB_ENV
3939
- uses: actions/setup-node@v4
4040
with:
4141
node-version: 20

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to this project are documented in this file.
1010
- winit: Fixed the maximize window not being disabled for fixed-size windows
1111
- winit: Added support for timer based frame throttling (#8826)
1212
- Fixed Windows native menu bar in fullscreen mode
13-
- Switched from WGPU24 to WGPU25
13+
- Switched from WGPU24 to WGPU26
1414
- Qt: Fixed default-font-size not working with PopupWindow
1515
- LinuxKMS: Added support for overriding the default framebuffer interface selection
1616
- LinuxKMS: Added support for a wide range of framebuffer formats
@@ -42,8 +42,8 @@ All notable changes to this project are documented in this file.
4242
### Rust
4343

4444
- Minimum Supported Rust Version (MSRV) is 1.85
45-
- Upgraded WGPU dependency to version 25: The `unstable-wgpu-25` Cargo feature replaces the old `unstable-wgpu-24` feature,
46-
and the `slint::wgpu_25` module replaces the `slint::wgpu_24` module. There were no further changes to the API.
45+
- Upgraded WGPU dependency to version 26: The `unstable-wgpu-26` Cargo feature replaces the old `unstable-wgpu-24` feature,
46+
and the `slint::wgpu_26` module replaces the `slint::wgpu_24` module. There were no further changes to the API.
4747
- Fixed compilation of generated code if the slint code declares a type named `core`
4848
- Support for live-reload with the `slint/live-reload` feature and `SLINT_LIVE_RELOAD` env variable
4949
- winit: Added API to await for the existence of the winit window

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ raw-window-handle-06 = { package = "raw-window-handle", version = "0.6", feature
166166
unicode-segmentation = { version = "1.12.0" }
167167
glow = { version = "0.16" }
168168
tikv-jemallocator = { version = "0.6" }
169-
wgpu-25 = { package = "wgpu", version = "25", default-features = false }
169+
wgpu-26 = { package = "wgpu", version = "26", default-features = false }
170170

171171
[profile.release]
172172
lto = true

api/cpp/cbindgen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fn default_config() -> cbindgen::Config {
243243
("target_arch = wasm32".into(), "SLINT_TARGET_WASM".into()),
244244
("target_os = android".into(), "__ANDROID__".into()),
245245
// Disable Rust WGPU specific API feature
246-
("feature = unstable-wgpu-25".into(), "SLINT_DISABLED_CODE".into()),
246+
("feature = unstable-wgpu-26".into(), "SLINT_DISABLED_CODE".into()),
247247
]
248248
.iter()
249249
.cloned()

api/rs/slint/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ backend-android-activity-05 = [
199199
## in your `Cargo.toml` when enabling this feature:
200200
##
201201
## ```toml
202-
## slint = { version = "~1.13", features = ["unstable-wgpu-25"] }
202+
## slint = { version = "~1.13", features = ["unstable-wgpu-26"] }
203203
## ```
204-
unstable-wgpu-25 = ["i-slint-core/unstable-wgpu-25", "i-slint-backend-selector/unstable-wgpu-25", "dep:wgpu-25"]
204+
unstable-wgpu-26 = ["i-slint-core/unstable-wgpu-26", "i-slint-backend-selector/unstable-wgpu-26", "dep:wgpu-26"]
205205

206206
## APIs guarded with this feature are *NOT* subject to the usual Slint API stability guarantees, because winit releases new major
207207
## versions more frequently than Slint. This feature as well as the APIs changed or removed in future minor releases of Slint, likely to be replaced
@@ -236,7 +236,7 @@ raw-window-handle-06 = { workspace = true, optional = true }
236236

237237
unicode-segmentation = { workspace = true }
238238

239-
wgpu-25 = { workspace = true, optional = true }
239+
wgpu-26 = { workspace = true, optional = true }
240240

241241
i-slint-backend-winit = { workspace = true, optional = true }
242242

@@ -271,7 +271,7 @@ features = [
271271
"renderer-software",
272272
"renderer-femtovg",
273273
"raw-window-handle-06",
274-
"unstable-wgpu-25",
274+
"unstable-wgpu-26",
275275
"unstable-winit-030",
276276
]
277277
rustdoc-args = ["--generate-link-to-definition"]

api/rs/slint/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,22 +446,22 @@ mod compile_fail_tests;
446446
#[cfg(doc)]
447447
pub mod docs;
448448

449-
#[cfg(feature = "unstable-wgpu-25")]
450-
pub mod wgpu_25 {
451-
//! WGPU 25.x specific types and re-exports.
449+
#[cfg(feature = "unstable-wgpu-26")]
450+
pub mod wgpu_26 {
451+
//! WGPU 26.x specific types and re-exports.
452452
//!
453453
//! *Note*: This module is behind a feature flag and may be removed or changed in future minor releases,
454454
//! as new major WGPU releases become available.
455455
//!
456456
//! Use the types in this module in combination with other APIs to integrate external, WGPU-based rendering engines
457457
//! into a UI with Slint.
458458
//!
459-
//! First, ensure that WGPU is used for rendering with Slint by using [`slint::BackendSelector::require_wgpu_25()`](i_slint_backend_selector::api::BackendSelector::require_wgpu_25()).
459+
//! First, ensure that WGPU is used for rendering with Slint by using [`slint::BackendSelector::require_wgpu_26()`](i_slint_backend_selector::api::BackendSelector::require_wgpu_26()).
460460
//! This function accepts a pre-configured WGPU setup or configuration hints such as required features or memory limits.
461461
//!
462462
//! For rendering, it's crucial that you're using the same [`wgpu::Device`] and [`wgpu::Queue`] for allocating textures or submitting commands as Slint. Obtain the same queue
463463
//! by either using [`WGPUConfiguration::Manual`] to make Slint use an existing WGPU configuration, or use [`slint::Window::set_rendering_notifier()`](i_slint_core::api::Window::set_rendering_notifier())
464-
//! to let Slint invoke a callback that provides access device, queue, etc. in [`slint::GraphicsAPI::WGPU25`](i_slint_core::api::GraphicsAPI::WGPU25).
464+
//! to let Slint invoke a callback that provides access device, queue, etc. in [`slint::GraphicsAPI::WGPU26`](i_slint_core::api::GraphicsAPI::WGPU26).
465465
//!
466466
//! To integrate rendering content into a scene shared with a Slint UI, use either [`slint::Window::set_rendering_notifier()`](i_slint_core::api::Window::set_rendering_notifier()) to render an underlay
467467
//! or overlay, or integrate externally produced [`wgpu::Texture`]s using [`slint::Image::try_from<wgpu::Texture>()`](i_slint_core::graphics::Image::try_from).
@@ -470,13 +470,13 @@ pub mod wgpu_25 {
470470
//!
471471
//! `Cargo.toml`:
472472
//! ```toml
473-
//! slint = { version = "~1.13", features = ["unstable-wgpu-25"] }
473+
//! slint = { version = "~1.13", features = ["unstable-wgpu-26"] }
474474
//! ```
475475
//!
476476
//! `main.rs`:
477477
//!```rust,no_run
478478
//!
479-
//! use slint::wgpu_25::wgpu;
479+
//! use slint::wgpu_26::wgpu;
480480
//! use wgpu::util::DeviceExt;
481481
//!
482482
//!slint::slint!{
@@ -495,14 +495,14 @@ pub mod wgpu_25 {
495495
//!}
496496
//!fn main() -> Result<(), Box<dyn std::error::Error>> {
497497
//! slint::BackendSelector::new()
498-
//! .require_wgpu_25(slint::wgpu_25::WGPUConfiguration::default())
498+
//! .require_wgpu_26(slint::wgpu_26::WGPUConfiguration::default())
499499
//! .select()?;
500500
//! let app = HelloWorld::new()?;
501501
//!
502502
//! let app_weak = app.as_weak();
503503
//!
504504
//! app.window().set_rendering_notifier(move |state, graphics_api| {
505-
//! let (Some(app), slint::RenderingState::RenderingSetup, slint::GraphicsAPI::WGPU25{ device, queue, ..}) = (app_weak.upgrade(), state, graphics_api) else {
505+
//! let (Some(app), slint::RenderingState::RenderingSetup, slint::GraphicsAPI::WGPU26{ device, queue, ..}) = (app_weak.upgrade(), state, graphics_api) else {
506506
//! return;
507507
//! };
508508
//!
@@ -540,7 +540,7 @@ pub mod wgpu_25 {
540540
//!}
541541
//!```
542542
//!
543-
pub use i_slint_core::graphics::wgpu_25::api::*;
543+
pub use i_slint_core::graphics::wgpu_26::api::*;
544544
}
545545

546546
#[cfg(feature = "unstable-winit-030")]

examples/bevy/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: MIT
33

44
# This example is not part of the Slint Cargo workspace because of the git dependency to bevy. Once bevy
5-
# releases a version to crates.io that depends on wgpu 25, we can re-insert the example into the workspace.
5+
# releases a version to crates.io that depends on WGPU 26, we can re-insert the example into the workspace.
66
[workspace]
77

88
[package]
@@ -19,10 +19,10 @@ name = "bevy_example"
1919
path = "main.rs"
2020

2121
[dependencies]
22-
slint = { path = "../../api/rs/slint", features = ["unstable-wgpu-25"] }
22+
slint = { path = "../../api/rs/slint", features = ["unstable-wgpu-26"] }
2323
spin_on = { version = "0.1" }
24-
bevy = { git = "https://github.com/bevyengine/bevy.git", rev = "96dcbc5f8c37753dd854b0902758d0e2030e0df9", version = "0.17.0-dev", default-features = false, features = ["bevy_core_pipeline", "bevy_pbr", "bevy_window", "bevy_scene", "bevy_gltf", "bevy_log", "jpeg", "png", "tonemapping_luts", "multi_threaded"] }
25-
bevy_utils = { git = "https://github.com/bevyengine/bevy.git", rev = "96dcbc5f8c37753dd854b0902758d0e2030e0df9", version = "0.17.0-dev", default-features = false, features = ["wgpu_wrapper"] }
24+
bevy = { git = "https://github.com/bevyengine/bevy.git", rev = "e11a9e1167764235819b1803f629b40f9ac5131c", version = "0.17.0-dev", default-features = false, features = ["bevy_core_pipeline", "bevy_pbr", "bevy_window", "bevy_scene", "bevy_gltf", "bevy_log", "jpeg", "png", "tonemapping_luts", "multi_threaded"] }
25+
bevy_image = { git = "https://github.com/bevyengine/bevy.git", rev = "e11a9e1167764235819b1803f629b40f9ac5131c", version = "0.17.0-dev", features = ["zstd_rust"] }
2626
smol = { version = "2.0.0" }
2727
async-compat = { version = "0.2.4" }
2828
reqwest = { version = "0.12", features = ["stream"] }

examples/bevy/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
125125
let Some(app) = app2.upgrade() else { return };
126126
app.window().request_redraw();
127127
let Ok(new_texture) = new_texture_receiver.try_recv() else { return };
128-
if let Some(old_texture) = app.get_texture().to_wgpu_25_texture() {
128+
if let Some(old_texture) = app.get_texture().to_wgpu_26_texture() {
129129
let control_message_sender = control_message_sender.clone();
130130
slint::spawn_local(async move {
131131
control_message_sender

examples/bevy/slint_bevy_adapter.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
use std::sync::Arc;
1111

12-
use slint::wgpu_25::wgpu;
12+
use slint::wgpu_26::wgpu;
1313

1414
use bevy::{
1515
prelude::*,
@@ -64,6 +64,7 @@ pub async fn run_bevy_app_with_slint(
6464
},
6565
noop: wgpu::NoopBackendOptions::default(),
6666
},
67+
memory_budget_thresholds: wgpu::MemoryBudgetThresholds::default(),
6768
})
6869
.await;
6970

@@ -72,11 +73,12 @@ pub async fn run_bevy_app_with_slint(
7273
&instance,
7374
&bevy::render::settings::WgpuSettings::default(),
7475
&wgpu::RequestAdapterOptions::default(),
76+
None,
7577
)
7678
.await;
7779

7880
let selector =
79-
slint::BackendSelector::new().require_wgpu_25(slint::wgpu_25::WGPUConfiguration::Manual {
81+
slint::BackendSelector::new().require_wgpu_26(slint::wgpu_26::WGPUConfiguration::Manual {
8082
instance: instance.clone(),
8183
adapter: (**adapter.0).clone(),
8284
device: render_device.wgpu_device().clone(),
@@ -154,12 +156,12 @@ pub async fn run_bevy_app_with_slint(
154156
back_buffer.0 = Some(next_back_buffer.clone());
155157

156158
let mut manual_texture_views = world
157-
.get_resource_mut::<bevy::render::camera::ManualTextureViews>()
159+
.get_resource_mut::<bevy::render::texture::ManualTextureViews>()
158160
.unwrap();
159161
manual_texture_views.clear();
160162
manual_texture_views.insert(
161163
texture_view_handle,
162-
bevy::render::camera::ManualTextureView {
164+
bevy::render::texture::ManualTextureView {
163165
texture_view: texture_view.into(),
164166
size: (next_back_buffer.width(), next_back_buffer.height()).into(),
165167
format: bevy::render::render_resource::TextureFormat::Rgba8UnormSrgb,
@@ -189,9 +191,9 @@ pub async fn run_bevy_app_with_slint(
189191
render_queue,
190192
adapter_info,
191193
adapter,
192-
bevy::render::renderer::RenderInstance(Arc::new(bevy_utils::WgpuWrapper::new(
193-
instance,
194-
))),
194+
bevy::render::renderer::RenderInstance(Arc::new(
195+
bevy::render::WgpuWrapper::new(instance),
196+
)),
195197
),
196198
..default()
197199
}), //.disable::<bevy::winit::WinitPlugin>(),

examples/wgpu_texture/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ path = "main.rs"
1515
name = "wgpu_texture"
1616

1717
[dependencies]
18-
slint = { path = "../../api/rs/slint", features = ["unstable-wgpu-25"] }
18+
slint = { path = "../../api/rs/slint", features = ["unstable-wgpu-26"] }
1919
bytemuck = { workspace = true }
2020

2121
[build-dependencies]

0 commit comments

Comments
 (0)