"Failed to create Skia context from WGPU" using WGPUConfiguration::Manual
need triaging
### Bug Description
After upgrading to the latest commit 789e670c running application using WGPUConfiguration::Manual is failed with error:
```
[skia-counter] adapter: Intel(R) Graphics (RPL-S)
Error: Failed to create Skia context from WGPU
```
Observations:
- It happens if Intel iGPU is used
- There's no such error if Nvidia dGPU is used, but the text is not rendered at all
- Most probably the cause is upgrading to latest `rust-skia` and `unstable-wgpu-29`, before upgrading `unstable-wgpu-28` was used and there was no problem
### Reproducible Code (if applicable)
```slint
slint::slint! {
import { Button, VerticalBox } from "std-widgets.slint";
export component MainWindow inherits Window {
in-out property <int> counter: 0;
title: "Slint (upstream) · Skia · WGPU (Intel)";
preferred-width: 360px;
preferred-height: 220px;
VerticalBox {
alignment: center;
spacing: 12px;
Text {
text: "Counter";
font-size: 14px;
horizontal-alignment: center;
}
Text {
// A number assigned to `text` is converted to a string by Slint.
text: root.counter;
font-size: 32px;
horizontal-alignment: center;
}
Button {
text: "Increment";
clicked => {
root.counter += 1;
}
}
}
}
}
```
```rust
use slint::wgpu_29::{WGPUConfiguration, wgpu};
const INTEL_VENDOR_ID: u32 = 0x8086;
fn pick_intel_adapter(instance: &wgpu::Instance) -> wgpu::Adapter {
let adapters = async_io::block_on(instance.enumerate_adapters(wgpu::Backends::VULKAN));
let intel = adapters
.iter()
.position(|a| a.get_info().vendor == INTEL_VENDOR_ID);
let adapter = match intel {
Some(i) => adapters.into_iter().nth(i).expect("index from position()"),
None => adapters
.into_iter()
.next()
.expect("no Vulkan adapter available"),
};
eprintln!("[skia-counter] adapter: {}", adapter.get_info().name);
adapter
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
// 1. Standard wgpu init, preferring the Intel GPU.
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::VULKAN,
..wgpu::InstanceDescriptor::new_without_display_handle()
});
let adapter = pick_intel_adapter(&instance);
let (device, queue) = async_io::block_on(adapter.request_device(&wgpu::DeviceDescriptor {
label: Some("skia-counter"),
..Default::default()
}))?;
// 2. Hand the same instance/adapter/device/queue to Slint and force the Skia
// renderer.
slint::BackendSelector::new()
.renderer_name("skia".into())
.require_wgpu_29(WGPUConfiguration::Manual {
instance,
adapter,
device,
queue,
})
.select()?;
// 3. Run the counter UI.
MainWindow::new()?.run()?;
Ok(())
}
```
### Environment Details
- Slint Version: 1.17.0 789e670c
- Platform/OS: Linux
- Programming Language: Rust
- Backend/Renderer: renderer-skia, unstable-wgpu-29
Cargo.toml
```toml
slint = { git = "https://github.com/slint-ui/slint", default-features = false, features = [
"compat-1-2",
"std",
"backend-winit",
"renderer-skia",
"unstable-wgpu-29",
] }
```
### Product Impact
_No response_
1 条评论