From 00c2528778f3e2918c38ceed02bf81bfd1df9077 Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Mon, 12 May 2025 23:00:59 +0800 Subject: [PATCH] Make sure to use the desired GPU when probing encoders with virtual display --- src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index fdc8450f..82802eb3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -25,6 +25,7 @@ #include "video.h" #ifdef _WIN32 + #include "platform/windows/misc.h" #include "platform/windows/virtual_display.h" #endif @@ -322,6 +323,12 @@ int main(int argc, char *argv[]) { auto probe_uuid = uuid_util::uuid_t::parse(probe_uuid_str); auto* probe_guid = (GUID*)(void*)&probe_uuid; + BOOST_LOG(info) << "Creating a temporary virtual display to probe for encoders..."sv; + + if (!config::video.adapter_name.empty()) { + VDISPLAY::setRenderAdapterByName(platf::from_utf8(config::video.adapter_name)); + } + VDISPLAY::createVirtualDisplay( probe_uuid_str.c_str(), "Probe",