WIP: Split off "create instance" code into fn

TODO: "Logical device and queues"
https://vulkan-tutorial.com/Drawing_a_triangle/Setup/Logical_device_and_queues
This commit is contained in:
Stephen Seo 2024-03-05 15:28:06 +09:00
parent 6194b4c1f2
commit 81ff94485f

View file

@ -222,7 +222,12 @@ impl VulkanApp {
panic!("Validation layers requested, but not available!");
}
// Create instance.
self.create_instance();
self.setup_debug_messenger();
self.pick_physical_device();
}
fn create_instance(&mut self) {
let app_name = CString::new("Vulkan Triangle").unwrap();
let engine_name = CString::new("No Engine").unwrap();
let app_info = ffi::VkApplicationInfo {
@ -297,9 +302,6 @@ impl VulkanApp {
if vk_result != ffi::VkResult_VK_SUCCESS {
panic!("ERROR: Failed to create vk instance!");
}
self.setup_debug_messenger();
self.pick_physical_device();
}
fn setup_debug_messenger(&mut self) {