Skip to content

Commit

Permalink
chore: add logs for perf_gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 15, 2024
1 parent f7d8806 commit 7837123
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions source/MaaUtils/GpuOption/GpuOptionWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ bool is_indirect_display_adapter(std::wstring_view instance_path)

std::optional<int> perfer_gpu()
{
LogTrace;

IDXGIFactory4* dxgi_factory = nullptr;
OnScopeLeave([&]() {
if (dxgi_factory) {
Expand All @@ -159,6 +161,7 @@ std::optional<int> perfer_gpu()

HRESULT hr = dxgi_factory->EnumAdapters1(adapter_index, &dxgi_adapter);
if (hr == DXGI_ERROR_NOT_FOUND) {
LogTrace << "EnumAdapters1 DXGI_ERROR_NOT_FOUND" << VAR(adapter_index);
break;
}
else if (FAILED(hr)) {
Expand Down Expand Up @@ -217,6 +220,7 @@ std::optional<int> perfer_gpu()
return adapter_index;
}

LogInfo << "no prefer adapter found";
return std::nullopt;
}

Expand Down

0 comments on commit 7837123

Please sign in to comment.