Vulkan: Add GetPhysicalDeviceInfo
Former-commit-id: 613eaa539d90c2480b0c20e09561a45df01e8b9e [formerly 5302439064226b00d49fa8bf2680980eaf806e7a] Former-commit-id: 62e30089bf6d93d893e86dda3d6fcd89e6a2688b
This commit is contained in:
parent
a41954842e
commit
90826e4467
|
|
@ -31,6 +31,7 @@ namespace Nz
|
||||||
static Vk::Instance& GetInstance();
|
static Vk::Instance& GetInstance();
|
||||||
|
|
||||||
static const std::vector<Vk::PhysicalDevice>& GetPhysicalDevices();
|
static const std::vector<Vk::PhysicalDevice>& GetPhysicalDevices();
|
||||||
|
static const Vk::PhysicalDevice& GetPhysicalDeviceInfo(VkPhysicalDevice physDevice);
|
||||||
|
|
||||||
static bool Initialize();
|
static bool Initialize();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,21 @@ namespace Nz
|
||||||
return s_physDevices;
|
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()
|
bool Vulkan::Initialize()
|
||||||
{
|
{
|
||||||
if (s_moduleReferenceCounter > 0)
|
if (s_moduleReferenceCounter > 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue