1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 07:29:17 +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,6 +6,7 @@ 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) {
try {
Com<DxgiFactory> factory = new DxgiFactory(Flags); Com<DxgiFactory> factory = new DxgiFactory(Flags);
HRESULT hr = factory->QueryInterface(riid, ppFactory); HRESULT hr = factory->QueryInterface(riid, ppFactory);
@ -13,6 +14,10 @@ namespace dxvk {
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;
}
} }
} }