Renderer: Add RenderDevice::GetDeviceInfo()

This commit is contained in:
Jérôme Leclercq
2021-05-14 01:55:16 +02:00
parent adbf1e1da0
commit aeac3282e4
11 changed files with 114 additions and 45 deletions

View File

@@ -69,36 +69,7 @@ namespace Nz
devices.reserve(physDevices.size());
for (const Vk::PhysicalDevice& physDevice : physDevices)
{
RenderDeviceInfo& device = devices.emplace_back();
device.name = physDevice.properties.deviceName;
switch (physDevice.properties.deviceType)
{
case VK_PHYSICAL_DEVICE_TYPE_CPU:
device.type = RenderDeviceType::Software;
break;
case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU:
device.type = RenderDeviceType::Dedicated;
break;
case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU:
device.type = RenderDeviceType::Integrated;
break;
case VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU:
device.type = RenderDeviceType::Virtual;
break;
default:
NazaraWarning("Device " + device.name + " has handled device type (0x" + NumberToString(physDevice.properties.deviceType, 16) + ')');
// fallthrough
case VK_PHYSICAL_DEVICE_TYPE_OTHER:
device.type = RenderDeviceType::Unknown;
break;
}
}
devices.push_back(Vulkan::BuildRenderDeviceInfo(physDevice));
return devices;
}