Use default limits for example (#98)

This commit is contained in:
Josh Groves 2024-05-27 00:04:17 -02:30 committed by GitHub
parent 0fdbd90c55
commit 2a45708767
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,11 +2,12 @@ use glyphon::{
Attrs, Buffer, Cache, Color, Family, FontSystem, Metrics, Resolution, Shaping, SwashCache, Attrs, Buffer, Cache, Color, Family, FontSystem, Metrics, Resolution, Shaping, SwashCache,
TextArea, TextAtlas, TextBounds, TextRenderer, Viewport, TextArea, TextAtlas, TextBounds, TextRenderer, Viewport,
}; };
use std::sync::Arc;
use wgpu::{ use wgpu::{
CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Features, Instance, CommandEncoderDescriptor, CompositeAlphaMode, DeviceDescriptor, Instance, InstanceDescriptor,
InstanceDescriptor, Limits, LoadOp, MultisampleState, Operations, PresentMode, LoadOp, MultisampleState, Operations, PresentMode, RenderPassColorAttachment,
RenderPassColorAttachment, RenderPassDescriptor, RequestAdapterOptions, SurfaceConfiguration, RenderPassDescriptor, RequestAdapterOptions, SurfaceConfiguration, TextureFormat,
TextureFormat, TextureUsages, TextureViewDescriptor, TextureUsages, TextureViewDescriptor,
}; };
use winit::{ use winit::{
dpi::LogicalSize, dpi::LogicalSize,
@ -15,8 +16,6 @@ use winit::{
window::WindowBuilder, window::WindowBuilder,
}; };
use std::sync::Arc;
fn main() { fn main() {
pollster::block_on(run()); pollster::block_on(run());
} }
@ -42,14 +41,7 @@ async fn run() {
.await .await
.unwrap(); .unwrap();
let (device, queue) = adapter let (device, queue) = adapter
.request_device( .request_device(&DeviceDescriptor::default(), None)
&DeviceDescriptor {
label: None,
required_features: Features::empty(),
required_limits: Limits::downlevel_defaults(),
},
None,
)
.await .await
.unwrap(); .unwrap();