From b11e619b193470050da2fd20fd4cbdb9e791e2b3 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 15 Nov 2021 14:55:41 +0200 Subject: [Vulkan] Check each device capabilities before selecting it. Split instance and physical device selection function and move device selection to window creation, to reject devices without present capability. Add device preferred type check in discrete > integrated > virtual > cpu > other order. Add device list printout. Add command line argument to override device selection. --- main/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'main') diff --git a/main/main.cpp b/main/main.cpp index 9f51025cc3..09a2a55259 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -323,6 +323,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print("].\n"); OS::get_singleton()->print(" --rendering-driver Rendering driver (depends on display driver).\n"); + OS::get_singleton()->print(" --gpu-index Use a specific GPU (run with --verbose to get available device list).\n"); OS::get_singleton()->print(" --text-driver Text driver (Fonts, BiDi, shaping)\n"); @@ -789,6 +790,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else if (I->get() == "-w" || I->get() == "--windowed") { // force windowed window init_windowed = true; + } else if (I->get() == "--gpu-index") { + if (I->next()) { + Engine::singleton->gpu_idx = I->next()->get().to_int(); + N = I->next()->next(); + } else { + OS::get_singleton()->print("Missing gpu index argument, aborting.\n"); + goto error; + } } else if (I->get() == "--vk-layers") { Engine::singleton->use_validation_layers = true; #ifdef DEBUG_ENABLED -- cgit v1.2.3