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:
parent
6194b4c1f2
commit
81ff94485f
1 changed files with 6 additions and 4 deletions
10
src/main.rs
10
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) {
|
||||
|
|
Loading…
Reference in a new issue