1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-14 22:29:15 +01:00

[dxgi] Catch exception when instance creation fails

Fixes #810.
This commit is contained in:
Philip Rebohle 2018-12-12 18:36:37 +01:00
parent f276bcd0e7
commit 64aefcc2a1
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -6,13 +6,18 @@ namespace dxvk {
Logger Logger::s_instance("dxgi.log"); Logger Logger::s_instance("dxgi.log");
HRESULT createDxgiFactory(UINT Flags, REFIID riid, void **ppFactory) { HRESULT createDxgiFactory(UINT Flags, REFIID riid, void **ppFactory) {
Com<DxgiFactory> factory = new DxgiFactory(Flags); try {
HRESULT hr = factory->QueryInterface(riid, ppFactory); Com<DxgiFactory> factory = new DxgiFactory(Flags);
HRESULT hr = factory->QueryInterface(riid, ppFactory);
if (FAILED(hr)) if (FAILED(hr))
return DXGI_ERROR_UNSUPPORTED; return DXGI_ERROR_UNSUPPORTED;
return S_OK; return S_OK;
} catch (const DxvkError& e) {
Logger::err(e.message());
return E_FAIL;
}
} }
} }