mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[host] dxgi: fix incorrect skip logic
This commit is contained in:
parent
57e20007db
commit
0f8c0b5fb3
@ -298,8 +298,6 @@ static bool dxgi_init(void)
|
||||
const char * optOutput = option_get_string("dxgi", "output" );
|
||||
|
||||
for (int i = 0; IDXGIFactory1_EnumAdapters1(this->factory, i, &this->adapter) != DXGI_ERROR_NOT_FOUND; ++i)
|
||||
{
|
||||
if (optAdapter)
|
||||
{
|
||||
DXGI_ADAPTER_DESC1 adapterDesc;
|
||||
status = IDXGIAdapter1_GetDesc1(this->adapter, &adapterDesc);
|
||||
@ -320,9 +318,14 @@ static bool dxgi_init(void)
|
||||
{
|
||||
DEBUG_INFO("Not using unsupported adapter: %ls",
|
||||
adapterDesc.Description);
|
||||
goto next_adapter;
|
||||
|
||||
IDXGIAdapter1_Release(this->adapter);
|
||||
this->adapter = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (optAdapter)
|
||||
{
|
||||
const size_t s = (wcslen(adapterDesc.Description)+1) * 2;
|
||||
char * desc = malloc(s);
|
||||
wcstombs(desc, adapterDesc.Description, s);
|
||||
@ -331,16 +334,14 @@ static bool dxgi_init(void)
|
||||
{
|
||||
DEBUG_INFO("Not using adapter: %ls", adapterDesc.Description);
|
||||
free(desc);
|
||||
goto next_adapter;
|
||||
|
||||
IDXGIAdapter1_Release(this->adapter);
|
||||
this->adapter = NULL;
|
||||
continue;
|
||||
}
|
||||
free(desc);
|
||||
|
||||
DEBUG_INFO("Adapter matched, trying: %ls", adapterDesc.Description);
|
||||
break;
|
||||
|
||||
next_adapter:
|
||||
IDXGIAdapter1_Release(this->adapter);
|
||||
this->adapter = NULL;
|
||||
}
|
||||
|
||||
for (int n = 0; IDXGIAdapter1_EnumOutputs(this->adapter, n, &this->output) != DXGI_ERROR_NOT_FOUND; ++n)
|
||||
|
Loading…
Reference in New Issue
Block a user