Add logs of physical devices
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s
This commit is contained in:
parent
06cc558baf
commit
56ad167b0f
5 changed files with 12 additions and 4 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
0
src/vulkan/utils.rs
Normal file
0
src/vulkan/utils.rs
Normal file
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<vk::QueueFamilyProperties>,
|
||||
pub properties: vk::PhysicalDeviceProperties,
|
||||
pub features: vk::PhysicalDeviceFeatures,
|
||||
pub queue_family_properties: Vec<vk::QueueFamilyProperties>,
|
||||
}
|
||||
|
||||
impl VkPhysicalDevice {
|
||||
|
|
Loading…
Reference in a new issue