Fix block_on in iced_wgpu hanging Wasm builds
This commit is contained in:
parent
1bb5a1b9a2
commit
ecf42b97df
8 changed files with 53 additions and 30 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue