diff --git a/include/Nazara/Vulkan/Vulkan.hpp b/include/Nazara/Vulkan/Vulkan.hpp index 289a1b225..a024d271a 100644 --- a/include/Nazara/Vulkan/Vulkan.hpp +++ b/include/Nazara/Vulkan/Vulkan.hpp @@ -31,6 +31,7 @@ namespace Nz static Vk::Instance& GetInstance(); static const std::vector& GetPhysicalDevices(); + static const Vk::PhysicalDevice& GetPhysicalDeviceInfo(VkPhysicalDevice physDevice); static bool Initialize(); diff --git a/src/Nazara/Vulkan/Vulkan.cpp b/src/Nazara/Vulkan/Vulkan.cpp index 025e9e875..6af41d9b2 100644 --- a/src/Nazara/Vulkan/Vulkan.cpp +++ b/src/Nazara/Vulkan/Vulkan.cpp @@ -24,6 +24,21 @@ namespace Nz return s_physDevices; } + const Vk::PhysicalDevice& Vulkan::GetPhysicalDeviceInfo(VkPhysicalDevice physDevice) + { + for (const Vk::PhysicalDevice& info : s_physDevices) + { + if (info.device == physDevice) + return info; + } + + // This cannot happen if physDevice is valid, as we retrieved every physical device + NazaraInternalError("Invalid physical device: " + String::Pointer(physDevice)); + + static Vk::PhysicalDevice dummy; + return dummy; + } + bool Vulkan::Initialize() { if (s_moduleReferenceCounter > 0)