From 81ff94485f98765250cfb6f0cb527479bdd4ef00 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Tue, 5 Mar 2024 15:28:06 +0900 Subject: [PATCH] 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 --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f75b8ac..d7759f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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) {