mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-29 10:06:28 +00:00
[host] dxgi: don't try to use devices without d3d support
This change should allow LG to work even if a virtual device is still attached to the VM even though it might be capturing the wrong display.
This commit is contained in:
parent
2901e7aec5
commit
57e20007db
@ -309,6 +309,20 @@ static bool dxgi_init(void)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for virtual devices without D3D support
|
||||||
|
if (
|
||||||
|
// Microsoft Basic Render Driver
|
||||||
|
(adapterDesc.VendorId == 0x1414 && adapterDesc.DeviceId == 0x008c) ||
|
||||||
|
// QXL
|
||||||
|
(adapterDesc.VendorId == 0x1b36 && adapterDesc.DeviceId == 0x000d) ||
|
||||||
|
// QEMU Standard VGA
|
||||||
|
(adapterDesc.VendorId == 0x1234 && adapterDesc.DeviceId == 0x1111))
|
||||||
|
{
|
||||||
|
DEBUG_INFO("Not using unsupported adapter: %ls",
|
||||||
|
adapterDesc.Description);
|
||||||
|
goto next_adapter;
|
||||||
|
}
|
||||||
|
|
||||||
const size_t s = (wcslen(adapterDesc.Description)+1) * 2;
|
const size_t s = (wcslen(adapterDesc.Description)+1) * 2;
|
||||||
char * desc = malloc(s);
|
char * desc = malloc(s);
|
||||||
wcstombs(desc, adapterDesc.Description, s);
|
wcstombs(desc, adapterDesc.Description, s);
|
||||||
@ -317,13 +331,16 @@ static bool dxgi_init(void)
|
|||||||
{
|
{
|
||||||
DEBUG_INFO("Not using adapter: %ls", adapterDesc.Description);
|
DEBUG_INFO("Not using adapter: %ls", adapterDesc.Description);
|
||||||
free(desc);
|
free(desc);
|
||||||
IDXGIAdapter1_Release(this->adapter);
|
goto next_adapter;
|
||||||
this->adapter = NULL;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
free(desc);
|
free(desc);
|
||||||
|
|
||||||
DEBUG_INFO("Adapter matched, trying: %ls", adapterDesc.Description);
|
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)
|
for (int n = 0; IDXGIAdapter1_EnumOutputs(this->adapter, n, &this->output) != DXGI_ERROR_NOT_FOUND; ++n)
|
||||||
@ -339,11 +356,8 @@ static bool dxgi_init(void)
|
|||||||
{
|
{
|
||||||
DEBUG_INFO("Not using adapter output: %ls", outputDesc.DeviceName);
|
DEBUG_INFO("Not using adapter output: %ls", outputDesc.DeviceName);
|
||||||
free(desc);
|
free(desc);
|
||||||
IDXGIOutput_Release(this->output);
|
goto next_output;
|
||||||
this->output = NULL;
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(desc);
|
free(desc);
|
||||||
|
|
||||||
DEBUG_INFO("Adapter output matched, trying: %ls", outputDesc.DeviceName);
|
DEBUG_INFO("Adapter output matched, trying: %ls", outputDesc.DeviceName);
|
||||||
@ -352,6 +366,7 @@ static bool dxgi_init(void)
|
|||||||
if (outputDesc.AttachedToDesktop)
|
if (outputDesc.AttachedToDesktop)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
next_output:
|
||||||
IDXGIOutput_Release(this->output);
|
IDXGIOutput_Release(this->output);
|
||||||
this->output = NULL;
|
this->output = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user