Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to wgpu 0.19.0 #80

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/grovesNL/glyphon"
license = "MIT OR Apache-2.0 OR Zlib"

[dependencies]
wgpu = "0.18"
wgpu = "0.19"
etagere = "0.2.10"
cosmic-text = "0.10"
lru = "0.12.1"
Expand Down
14 changes: 9 additions & 5 deletions examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use winit::{
window::WindowBuilder,
};

use std::sync::Arc;

fn main() {
pollster::block_on(run());
}
Expand All @@ -23,11 +25,11 @@ async fn run() {
// Set up window
let (width, height) = (800, 600);
let event_loop = EventLoop::new().unwrap();
let window = WindowBuilder::new()
let window = Arc::new(WindowBuilder::new()
.with_inner_size(LogicalSize::new(width as f64, height as f64))
.with_title("glyphon hello world")
.build(&event_loop)
.unwrap();
.unwrap());
let size = window.inner_size();
let scale_factor = window.scale_factor();

Expand All @@ -41,14 +43,15 @@ async fn run() {
.request_device(
&DeviceDescriptor {
label: None,
features: Features::empty(),
limits: Limits::downlevel_defaults(),
required_features: Features::empty(),
required_limits: Limits::downlevel_defaults(),
},
None,
)
.await
.unwrap();
let surface = unsafe { instance.create_surface(&window) }.expect("Create surface");

let surface = instance.create_surface(window.clone()).expect("Create surface");
let swapchain_format = TextureFormat::Bgra8UnormSrgb;
let mut config = SurfaceConfiguration {
usage: TextureUsages::RENDER_ATTACHMENT,
Expand All @@ -58,6 +61,7 @@ async fn run() {
present_mode: PresentMode::Fifo,
alpha_mode: CompositeAlphaMode::Opaque,
view_formats: vec![],
desired_maximum_frame_latency: 2,
};
surface.configure(&device, &config);

Expand Down