Add prefer discrete logic to RenderDevice::choose_device()

This commit is contained in:
2025-05-09 16:09:08 +10:00
parent fd5cdbf692
commit b25e5936e2

View File

@@ -18,6 +18,8 @@ u32 RenderDevice::choose_device(RenderDriver* p_driver, std::span<const SurfaceI
u32 best_index = std::numeric_limits<u32>::max();
u32 best_score = 0;
const bool prefer_discrete = true; // TODO: Get from config
for (u32 i = 0; i < p_driver->get_device_count(); i++) {
auto& device = p_driver->get_device(i);
u32 score = 1;
@@ -34,10 +36,10 @@ u32 RenderDevice::choose_device(RenderDriver* p_driver, std::span<const SurfaceI
switch (device.type) {
case Type::DISCRETE:
score += 4;
score += prefer_discrete ? 4 : 3;
break;
case Type::INTEGRATED:
score += 3;
score += prefer_discrete ? 3 : 4;
break;
case Type::VIRTUAL:
score += 2;