diff --git a/src/client/main.cpp b/src/client/main.cpp index dc49c219..7527ca7f 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -227,26 +227,12 @@ namespace const auto self = utils::nt::library::get_by_address(&trigger_high_performance_gpu_switch); const auto path = self.get_path().make_preferred().wstring(); - /*if (RegQueryValueExW(key, path.data(), nullptr, nullptr, nullptr, nullptr) != ERROR_FILE_NOT_FOUND) + if (RegQueryValueExW(key, path.data(), nullptr, nullptr, nullptr, nullptr) != ERROR_FILE_NOT_FOUND) { return; - }*/ - - auto preference = DXGI_GPU_PREFERENCE_UNSPECIFIED; - - CComPtr factory{}; - if (SUCCEEDED(CreateDXGIFactory1(__uuidof(IDXGIFactory6), reinterpret_cast(&factory)))) - { - CComPtr adapter{}; - if (SUCCEEDED( - factory->EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, __uuidof(IDXGIAdapter), - reinterpret_cast(&adapter))) && adapter) - { - preference = DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE; - } } - const std::wstring data = L"GpuPreference=" + std::to_wstring(preference) + L";"; + const std::wstring data = L"GpuPreference=2;"; RegSetValueExW(key, self.get_path().make_preferred().wstring().data(), 0, REG_SZ, reinterpret_cast(data.data()), static_cast((data.size() + 1u) * 2));