You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## in your `Cargo.toml` when enabling this feature:
200
200
##
201
201
## ```toml
202
-
## slint = { version = "~1.13", features = ["unstable-wgpu-26"] }
202
+
## slint = { version = "~1.14", features = ["unstable-wgpu-26"] }
203
203
## ```
204
204
unstable-wgpu-26 = [
205
205
"i-slint-core/unstable-wgpu-26",
@@ -208,6 +208,25 @@ unstable-wgpu-26 = [
208
208
"dep:wgpu-26",
209
209
]
210
210
211
+
## Enable support for [WGPU](http://wgpu.rs) based rendering and expose WGPU based APIs based on WGPU version 27.x.
212
+
##
213
+
## APIs guarded with this feature are *NOT* subject to the usual Slint API stability guarantees, because WGPU releases new major
214
+
## versions frequently. This feature as well as the APIs changed or removed in future minor releases of Slint, likely to be replaced
215
+
## by a feature with a similar name but the WGPU version suffix being bumped.
216
+
##
217
+
## To avoid unintended compilation failures, we recommend to use the [tilde requirement](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#tilde-requirements)
218
+
## in your `Cargo.toml` when enabling this feature:
219
+
##
220
+
## ```toml
221
+
## slint = { version = "~1.14", features = ["unstable-wgpu-27"] }
Copy file name to clipboardExpand all lines: api/rs/slint/lib.rs
+97Lines changed: 97 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -540,6 +540,103 @@ pub mod wgpu_26 {
540
540
pubuse i_slint_core::graphics::wgpu_26::api::*;
541
541
}
542
542
543
+
#[cfg(feature = "unstable-wgpu-27")]
544
+
pubmod wgpu_27 {
545
+
//! WGPU 27.x specific types and re-exports.
546
+
//!
547
+
//! *Note*: This module is behind a feature flag and may be removed or changed in future minor releases,
548
+
//! as new major WGPU releases become available.
549
+
//!
550
+
//! Use the types in this module in combination with other APIs to integrate external, WGPU-based rendering engines
551
+
//! into a UI with Slint.
552
+
//!
553
+
//! 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()).
554
+
//! This function accepts a pre-configured WGPU setup or configuration hints such as required features or memory limits.
555
+
//!
556
+
//! 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
557
+
//! 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())
558
+
//! to let Slint invoke a callback that provides access device, queue, etc. in [`slint::GraphicsAPI::WGPU26`](i_slint_core::api::GraphicsAPI::WGPU26).
559
+
//!
560
+
//! 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
561
+
//! or overlay, or integrate externally produced [`wgpu::Texture`]s using [`slint::Image::try_from<wgpu::Texture>()`](i_slint_core::graphics::Image::try_from).
562
+
//!
563
+
//! The following example allocates a [`wgpu::Texture`] and, for the sake of simplicity in this documentation, fills with green as color, and then proceeds to set it as a `slint::Image` in the scene.
564
+
//!
565
+
//! `Cargo.toml`:
566
+
//! ```toml
567
+
//! slint = { version = "~1.14", features = ["unstable-wgpu-27"] }
0 commit comments