[host] d12: handle IDXGIAdapter::EnumOutputs errors
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / idd (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run

Before, the code treated any errors other than DXGI_ERROR_NOT_FOUND as if
they were successes, which is incorrect.
This commit is contained in:
Quantum
2026-06-16 22:31:34 -04:00
committed by Geoffrey McRae
parent 4bb2c58fb6
commit 1f3051e81a

View File

@@ -987,11 +987,17 @@ static bool d12_enumerateDevices(
DEBUG_INFO("Adapter matched, trying: %ls", adapterDesc.Description);
}
for(
int n = 0;
IDXGIAdapter1_EnumOutputs(*adapter, n, output) != DXGI_ERROR_NOT_FOUND;
++n, comRef_release(output))
for (int n = 0; ; ++n, comRef_release(output))
{
HRESULT hr = IDXGIAdapter1_EnumOutputs(*adapter, n, output);
if (FAILED(hr))
{
if (hr != DXGI_ERROR_NOT_FOUND)
DEBUG_WINERROR("Failed to IDXGIAdapter::EnumOutputs", hr);
break;
}
IDXGIOutput_GetDesc(*output, &outputDesc);
if (optOutput)