// video::ChooseGpu and GpuLogLine (runtime/video/gpu_choice.h): the Vulkan // device the presenter draws with, and the log's line about it. Header only; // built by tests/CMakeLists.txt (-DSB_TESTS=ON), or from the repo root: // clang++ -std=c++20 -O2 -Iruntime tests/gpu_choice_test.cpp -o build/gpu_choice_test // 1. The devices we ship on, as their logs name them (one GPU each): that GPU, // the loader's first, as up to v0.1.1 ("the only one"). // 2. Laptops with two GPUs: Intel + NVIDIA (PR #6's i9-13900H + RTX 3050, in // either order), AMD integrated + NVIDIA, AMD + AMD; an NVIDIA GPU alone; a // lone integrated GPU. // 3. A software renderer (llvmpipe) beside a real GPU, in either order; Mesa's // Dozen after native drivers; two discrete GPUs: the one with more // device-local memory, the loader's first when equal. // 4. A device that can't present is never chosen; one without an extension // the game needs comes after those with all. // 5. NFSMW_GPU: an index, part of a name in any case, a number that is part // of a name, a device that can't present, no match, empty. // 6. The log line, word for word. // 7. Against an independent ranking over 20,000 random lists, and the rule // before v0.1.2 (the loader's first that can present) wherever exactly one // device can present. #include