[Feat] (MG_Backend/DirectVulkan): more friendly device picker log

This commit is contained in:
2026-02-12 12:55:18 +08:00
parent 178dbd33ba
commit 74ff24e4a4
@@ -265,7 +265,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
Bool deviceExtSupported = IsNecessaryDeviceExtensionSupported(newVkDevice); Bool deviceExtSupported = IsNecessaryDeviceExtensionSupported(newVkDevice);
if (!deviceExtSupported) { if (!deviceExtSupported) {
outBetterDevice = otherDevice; outBetterDevice = otherDevice;
MGLOG_I(" Ignored physical device: Some of the required device extension not supported on this device."); MGLOG_I(" Ignored physical device. (Reason: Some of the required device extension not supported on this device)");
return false; return false;
} }
@@ -273,7 +273,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
newDevice.swapchainCapabilities = GetSwapchainCapabilities(newVkDevice, surface); newDevice.swapchainCapabilities = GetSwapchainCapabilities(newVkDevice, surface);
if (!newDevice.swapchainCapabilities.IsComplete()) { if (!newDevice.swapchainCapabilities.IsComplete()) {
outBetterDevice = otherDevice; outBetterDevice = otherDevice;
MGLOG_I(" Ignored physical device: Swapchain capabilities not met."); MGLOG_I(" Ignored physical device. (Reason: Swapchain capabilities not met)");
return false; return false;
} }
@@ -282,7 +282,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
newDevice.queueFamilies.graphicsFamily = GetQueueFamilyIndex(queueFamilies, VK_QUEUE_GRAPHICS_BIT); newDevice.queueFamilies.graphicsFamily = GetQueueFamilyIndex(queueFamilies, VK_QUEUE_GRAPHICS_BIT);
if (newDevice.queueFamilies.graphicsFamily == -1) { if (newDevice.queueFamilies.graphicsFamily == -1) {
outBetterDevice = otherDevice; outBetterDevice = otherDevice;
MGLOG_I(" Ignored physical device: No graphics queue family."); MGLOG_I(" Ignored physical device. (Reason: No graphics queue family)");
return false; return false;
} }
@@ -290,7 +290,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
GetPresentQueueFamilyIndex(newDevice, surface, queueFamilies, newDevice.queueFamilies.graphicsFamily); GetPresentQueueFamilyIndex(newDevice, surface, queueFamilies, newDevice.queueFamilies.graphicsFamily);
if (newDevice.queueFamilies.presentFamily == -1) { if (newDevice.queueFamilies.presentFamily == -1) {
outBetterDevice = otherDevice; outBetterDevice = otherDevice;
MGLOG_I(" Ignored physical device: No present queue family."); MGLOG_I(" Ignored physical device. (Reason: No present queue family)");
return false; return false;
} }
@@ -298,7 +298,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
if (newDevice.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && if (newDevice.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU &&
otherDevice.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { otherDevice.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) {
outBetterDevice = newDevice; outBetterDevice = newDevice;
MGLOG_I(" Picked physical device: Discrete GPU."); MGLOG_I(" Picked physical device. (Reason: Discrete GPU)");
return true; return true;
} }
@@ -306,7 +306,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
if (newDevice.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU && if (newDevice.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU &&
otherDevice.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { otherDevice.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) {
outBetterDevice = newDevice; outBetterDevice = newDevice;
MGLOG_I(" Picked physical device: Integrated GPU and no discrete one found yet."); MGLOG_I(" Picked physical device. (Reason: Integrated GPU and no discrete one found yet)");
return true; return true;
} }
@@ -314,7 +314,7 @@ namespace MobileGL::MG_Backend::DirectVulkan {
if (newDevice.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && if (newDevice.properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU &&
otherDevice.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { otherDevice.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) {
outBetterDevice = newDevice; outBetterDevice = newDevice;
MGLOG_I(" Ignored physical device: Already picked discrete GPU."); MGLOG_I(" Ignored physical device. (Reason: Already picked discrete GPU)");
return false; return false;
} }