WGPU: Add support for using WGPU textures in Slint

This adds a `unstable-wgpu-24` feature that exposes WGPU types in the
GraphicsAPI enum, adds `require_wgpu_24()` to the backend selector,
and adds a conversion from `wgpu::Texture` to `slint::Image`.

The `require_wgpu_24()` function in the selector will be extended in the
future (before the next release) to permit specifying additional aspects
of the WGPU configuration.

Co-Authored-By: Olivier Goffart <olivier.goffart@slint.dev>
This commit is contained in:
Simon Hausmann 2025-04-25 14:00:52 +02:00 committed by Simon Hausmann
parent 8261e405d3
commit da5e7d5b22
28 changed files with 711 additions and 27 deletions

View file

@ -238,6 +238,8 @@ fn default_config() -> cbindgen::Config {
// Disable any wasm guarded code in C++, too - so that there are no gaps in enums.
("target_arch = wasm32".into(), "SLINT_TARGET_WASM".into()),
("target_os = android".into(), "__ANDROID__".into()),
// Disable Rust WGPU specific API feature
("feature = unstable-wgpu-24".into(), "SLINT_DISABLED_CODE".into()),
]
.iter()
.cloned()