diff options
| author | 2022-01-28 16:58:11 +0700 | |
|---|---|---|
| committer | 2022-01-28 21:37:16 +0700 | |
| commit | 776724162aa4351310de9f88c7bb8d61b0abca04 (patch) | |
| tree | 27bbfdfdd36fcf05772d2b088da88df077f3e30f /wgpu | |
| parent | 26d95fdc4b7b6a66431d45f49edd0cc3ef19823f (diff) | |
| download | iced-776724162aa4351310de9f88c7bb8d61b0abca04.tar.gz iced-776724162aa4351310de9f88c7bb8d61b0abca04.tar.bz2 iced-776724162aa4351310de9f88c7bb8d61b0abca04.zip | |
Use WebGL2 limits for `Compositor` in `iced_wgpu`
Diffstat (limited to '')
| -rw-r--r-- | wgpu/src/window/compositor.rs | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 3b264475..6feb795b 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -48,6 +48,13 @@ impl Compositor {              .as_ref()              .and_then(|surface| surface.get_preferred_format(&adapter))?; +        #[cfg(target_arch = "wasm32")] +        let limits = wgpu::Limits::downlevel_webgl2_defaults() +            .using_resolution(adapter.limits()); + +        #[cfg(not(target_arch = "wasm32"))] +        let limits = wgpu::Limits::default(); +          let (device, queue) = adapter              .request_device(                  &wgpu::DeviceDescriptor { @@ -57,7 +64,7 @@ impl Compositor {                      features: wgpu::Features::empty(),                      limits: wgpu::Limits {                          max_bind_groups: 2, -                        ..wgpu::Limits::default() +                        ..limits                      },                  },                  None, | 
