Skip to content

Commit

Permalink
Update dependencies (#2385)
Browse files Browse the repository at this point in the history
* Update winit

* Update raw-window-handle

* Update syn

* Remove vulkano-win from the workspace
  • Loading branch information
marc0246 authored Oct 31, 2023
1 parent 3664c07 commit 4a77d39
Show file tree
Hide file tree
Showing 30 changed files with 1,837 additions and 1,581 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = [
"vulkano-macros",
"vulkano-shaders",
"vulkano-util",
"vulkano-win",
# "vulkano-win",
]
resolver = "2"

Expand Down Expand Up @@ -44,13 +44,13 @@ parking_lot = "0.12"
proc-macro2 = "1.0"
proc-macro-crate = "1.2"
quote = "1.0"
raw-window-handle = "0.5"
raw-window-handle = "0.6"
regex = "1.8"
serde = "1.0"
serde_json = "1.0"
shaderc = "0.8"
smallvec = "1.8"
syn = "1.0"
syn = "2.0"
thread_local = "1.1"
vk-parse = "0.12"
winit = "0.28"
winit = "0.29"
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ vulkano = { path = "../vulkano" }
vulkano-macros = { path = "../vulkano-macros" }
vulkano-shaders = { path = "../vulkano-shaders" }
vulkano-util = { path = "../vulkano-util" }
winit = "0.28"
winit = "0.29"
30 changes: 19 additions & 11 deletions examples/async-update/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use cgmath::{Matrix4, Rad};
use rand::Rng;
use std::{
error::Error,
hint,
sync::{
atomic::{AtomicBool, AtomicU64, Ordering},
Expand Down Expand Up @@ -91,18 +92,19 @@ use vulkano::{
Validated, VulkanError, VulkanLibrary,
};
use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event::{ElementState, Event, KeyEvent, WindowEvent},
event_loop::{ControlFlow, EventLoop},
keyboard::{Key, NamedKey},
window::WindowBuilder,
};

const TRANSFER_GRANULARITY: u32 = 4096;

fn main() {
let event_loop = EventLoop::new();
fn main() -> Result<(), impl Error> {
let event_loop = EventLoop::new().unwrap();

let library = VulkanLibrary::new().unwrap();
let required_extensions = Surface::required_extensions(&event_loop);
let required_extensions = Surface::required_extensions(&event_loop).unwrap();
let instance = Instance::new(
library,
InstanceCreateInfo {
Expand Down Expand Up @@ -521,13 +523,15 @@ fn main() {

println!("\nPress space to update part of the texture");

event_loop.run(move |event, _, control_flow| {
event_loop.run(move |event, elwt| {
elwt.set_control_flow(ControlFlow::Poll);

match event {
Event::WindowEvent {
event: WindowEvent::CloseRequested,
..
} => {
*control_flow = ControlFlow::Exit;
elwt.exit();
}
Event::WindowEvent {
event: WindowEvent::Resized(_),
Expand All @@ -538,10 +542,10 @@ fn main() {
Event::WindowEvent {
event:
WindowEvent::KeyboardInput {
input:
KeyboardInput {
event:
KeyEvent {
logical_key: Key::Named(NamedKey::Space),
state: ElementState::Released,
virtual_keycode: Some(VirtualKeyCode::Space),
..
},
..
Expand All @@ -550,7 +554,10 @@ fn main() {
} => {
channel.send(()).unwrap();
}
Event::RedrawEventsCleared => {
Event::WindowEvent {
event: WindowEvent::RedrawRequested,
..
} => {
let image_extent: [u32; 2] = window.inner_size().into();

if image_extent.contains(&0) {
Expand Down Expand Up @@ -685,9 +692,10 @@ fn main() {
}
}
}
Event::AboutToWait => window.request_redraw(),
_ => (),
}
});
})
}

#[allow(clippy::too_many_arguments)]
Expand Down
21 changes: 14 additions & 7 deletions examples/buffer-allocator/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// Modified triangle example to show `SubbufferAllocator`.

use std::{
error::Error,
sync::Arc,
time::{SystemTime, UNIX_EPOCH},
};
Expand Down Expand Up @@ -55,11 +56,11 @@ use winit::{
window::WindowBuilder,
};

fn main() {
let event_loop = EventLoop::new();
fn main() -> Result<(), impl Error> {
let event_loop = EventLoop::new().unwrap();

let library = VulkanLibrary::new().unwrap();
let required_extensions = Surface::required_extensions(&event_loop);
let required_extensions = Surface::required_extensions(&event_loop).unwrap();
let instance = Instance::new(
library,
InstanceCreateInfo {
Expand Down Expand Up @@ -280,21 +281,26 @@ fn main() {
let command_buffer_allocator =
StandardCommandBufferAllocator::new(device.clone(), Default::default());

event_loop.run(move |event, _, control_flow| {
event_loop.run(move |event, elwt| {
elwt.set_control_flow(ControlFlow::Poll);

match event {
Event::WindowEvent {
event: WindowEvent::CloseRequested,
..
} => {
*control_flow = ControlFlow::Exit;
elwt.exit();
}
Event::WindowEvent {
event: WindowEvent::Resized(_),
..
} => {
recreate_swapchain = true;
}
Event::RedrawEventsCleared => {
Event::WindowEvent {
event: WindowEvent::RedrawRequested,
..
} => {
let image_extent: [u32; 2] = window.inner_size().into();

if image_extent.contains(&0) {
Expand Down Expand Up @@ -426,9 +432,10 @@ fn main() {
}
}
}
Event::AboutToWait => window.request_redraw(),
_ => (),
}
});
})
}

/// This function is called once during initialization, then again whenever the window is resized.
Expand Down
Loading

0 comments on commit 4a77d39

Please sign in to comment.