Update winit to 0.16
This commit is contained in:
parent
e3526b467c
commit
2c5364871e
|
@ -4,7 +4,7 @@ version = "0.1.0"
|
|||
authors = ["maik klein <maikklein@googlemail.com>"]
|
||||
|
||||
[dependencies]
|
||||
winit = "0.11.1"
|
||||
winit = "0.16"
|
||||
image = "0.10.4"
|
||||
ash = { path = "../ash" }
|
||||
|
||||
|
|
|
@ -46,8 +46,7 @@ pub fn record_submit_commandbuffer<D: DeviceV1_0, F: FnOnce(&D, vk::CommandBuffe
|
|||
.reset_command_buffer(
|
||||
command_buffer,
|
||||
vk::CommandBufferResetFlags::RELEASE_RESOURCES,
|
||||
)
|
||||
.expect("Reset command buffer failed.");
|
||||
).expect("Reset command buffer failed.");
|
||||
let command_buffer_begin_info = vk::CommandBufferBeginInfo {
|
||||
s_type: vk::StructureType::COMMAND_BUFFER_BEGIN_INFO,
|
||||
p_next: ptr::null(),
|
||||
|
@ -254,7 +253,7 @@ impl ExampleBase {
|
|||
ControlFlow::Continue
|
||||
}
|
||||
}
|
||||
WindowEvent::Closed => winit::ControlFlow::Break,
|
||||
WindowEvent::Destroyed => winit::ControlFlow::Break,
|
||||
_ => ControlFlow::Continue,
|
||||
},
|
||||
_ => ControlFlow::Continue,
|
||||
|
@ -267,8 +266,10 @@ impl ExampleBase {
|
|||
let events_loop = winit::EventsLoop::new();
|
||||
let window = winit::WindowBuilder::new()
|
||||
.with_title("Ash - Example")
|
||||
.with_dimensions(window_width, window_height)
|
||||
.build(&events_loop)
|
||||
.with_dimensions(winit::dpi::LogicalSize::new(
|
||||
window_width as f64,
|
||||
window_height as f64,
|
||||
)).build(&events_loop)
|
||||
.unwrap();
|
||||
let entry = Entry::new().unwrap();
|
||||
let app_name = CString::new("VulkanTriangle").unwrap();
|
||||
|
@ -331,8 +332,8 @@ impl ExampleBase {
|
|||
.enumerate()
|
||||
.filter_map(|(index, ref info)| {
|
||||
let supports_graphic_and_surface =
|
||||
info.queue_flags.subset(vk::QueueFlags::GRAPHICS)
|
||||
&& surface_loader.get_physical_device_surface_support_khr(
|
||||
info.queue_flags.subset(vk::QueueFlags::GRAPHICS) && surface_loader
|
||||
.get_physical_device_surface_support_khr(
|
||||
*pdevice,
|
||||
index as u32,
|
||||
surface,
|
||||
|
@ -341,10 +342,8 @@ impl ExampleBase {
|
|||
true => Some((*pdevice, index)),
|
||||
_ => None,
|
||||
}
|
||||
})
|
||||
.nth(0)
|
||||
})
|
||||
.filter_map(|v| v)
|
||||
}).nth(0)
|
||||
}).filter_map(|v| v)
|
||||
.nth(0)
|
||||
.expect("Couldn't find suitable device.");
|
||||
let queue_family_index = queue_family_index as u32;
|
||||
|
@ -390,8 +389,7 @@ impl ExampleBase {
|
|||
color_space: sfmt.color_space,
|
||||
},
|
||||
_ => sfmt.clone(),
|
||||
})
|
||||
.nth(0)
|
||||
}).nth(0)
|
||||
.expect("Unable to find suitable surface format.");
|
||||
let surface_capabilities = surface_loader
|
||||
.get_physical_device_surface_capabilities_khr(pdevice, surface)
|
||||
|
@ -498,8 +496,7 @@ impl ExampleBase {
|
|||
image: image,
|
||||
};
|
||||
device.create_image_view(&create_view_info, None).unwrap()
|
||||
})
|
||||
.collect();
|
||||
}).collect();
|
||||
let device_memory_properties = instance.get_physical_device_memory_properties(pdevice);
|
||||
let depth_image_create_info = vk::ImageCreateInfo {
|
||||
s_type: vk::StructureType::IMAGE_CREATE_INFO,
|
||||
|
@ -524,12 +521,11 @@ impl ExampleBase {
|
|||
};
|
||||
let depth_image = device.create_image(&depth_image_create_info, None).unwrap();
|
||||
let depth_image_memory_req = device.get_image_memory_requirements(depth_image);
|
||||
let depth_image_memory_index =
|
||||
find_memorytype_index(
|
||||
&depth_image_memory_req,
|
||||
&device_memory_properties,
|
||||
vk::MemoryPropertyFlags::DEVICE_LOCAL,
|
||||
).expect("Unable to find suitable memory index for depth image.");
|
||||
let depth_image_memory_index = find_memorytype_index(
|
||||
&depth_image_memory_req,
|
||||
&device_memory_properties,
|
||||
vk::MemoryPropertyFlags::DEVICE_LOCAL,
|
||||
).expect("Unable to find suitable memory index for depth image.");
|
||||
|
||||
let depth_image_allocate_info = vk::MemoryAllocateInfo {
|
||||
s_type: vk::StructureType::MEMORY_ALLOCATE_INFO,
|
||||
|
|
Loading…
Reference in a new issue