diff --git a/src/display/app.rs b/src/display/app.rs index 78d5cbc..5bc0f9a 100644 --- a/src/display/app.rs +++ b/src/display/app.rs @@ -36,7 +36,12 @@ impl ApplicationHandler for App { .and_then(|w| Some(VkInstance::new(w))); if let Some(instance) = self.instance.as_ref() { - let _ = instance.get_physical_devices(); + let physical_devices = instance.get_physical_devices(); + + println!("Physical Devices:"); + for physical_device in physical_devices { + println!("\tNom: {:?}, Priorité: {}", physical_device.properties.device_name_as_c_str().unwrap_or_default(), physical_device.priority()) + } } } diff --git a/src/vulkan/mod.rs b/src/vulkan/mod.rs index c34e218..6ea722f 100644 --- a/src/vulkan/mod.rs +++ b/src/vulkan/mod.rs @@ -1,5 +1,6 @@ pub(self) mod vk_instance; pub(self) mod vk_physical_device; +mod utils; pub use vk_instance::VkInstance; pub use vk_physical_device::VkPhysicalDevice; \ No newline at end of file diff --git a/src/vulkan/utils.rs b/src/vulkan/utils.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/vulkan/vk_instance.rs b/src/vulkan/vk_instance.rs index 42f1630..b634cbb 100644 --- a/src/vulkan/vk_instance.rs +++ b/src/vulkan/vk_instance.rs @@ -4,6 +4,7 @@ use winit::raw_window_handle::{HasDisplayHandle}; use crate::vulkan::VkPhysicalDevice; pub struct VkInstance { + entry: Entry, handle: Instance, } @@ -57,6 +58,7 @@ impl VkInstance { }; Self { + entry, handle: instance } } diff --git a/src/vulkan/vk_physical_device.rs b/src/vulkan/vk_physical_device.rs index 0b0ee2a..b5de904 100644 --- a/src/vulkan/vk_physical_device.rs +++ b/src/vulkan/vk_physical_device.rs @@ -3,9 +3,9 @@ use ash::vk; pub struct VkPhysicalDevice { // Vulkan properties handle: vk::PhysicalDevice, - properties: vk::PhysicalDeviceProperties, - features: vk::PhysicalDeviceFeatures, - queue_family_properties: Vec, + pub properties: vk::PhysicalDeviceProperties, + pub features: vk::PhysicalDeviceFeatures, + pub queue_family_properties: Vec, } impl VkPhysicalDevice {