Fix block_on in iced_wgpu hanging Wasm builds

This commit is contained in:
Héctor Ramón Jiménez 2024-03-07 23:25:24 +01:00
parent 1bb5a1b9a2
commit ecf42b97df
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 53 additions and 30 deletions

View file

@ -5,6 +5,7 @@ use crate::graphics::{Error, Viewport};
use crate::{Backend, Primitive, Renderer, Settings};
use std::collections::VecDeque;
use std::future::{self, Future};
use std::num::NonZeroU32;
pub struct Compositor {
@ -31,8 +32,8 @@ impl crate::graphics::Compositor for Compositor {
fn new<W: compositor::Window>(
settings: Self::Settings,
compatible_window: W,
) -> Result<Self, Error> {
Ok(new(settings, compatible_window))
) -> impl Future<Output = Result<Self, Error>> {
future::ready(Ok(new(settings, compatible_window)))
}
fn create_renderer(&self) -> Self::Renderer {