mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 04:50:35 +00:00
Check the D3D12 DLL can be loaded before using it
* It looks like some versions of the D3D12 DLL can't be loaded on all versions of windows (they require entry points and/or DLLs that don't exist).
This commit is contained in:
@@ -509,6 +509,23 @@ void D3D12_PrepareReplaySDKVersion(UINT SDKVersion, bytebuf d3d12core_file,
|
||||
{
|
||||
RDCERR("Couldn't write embedded D3D12Core.dll to disk! system dll will be used");
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT prevErrorMode = GetErrorMode();
|
||||
SetErrorMode(prevErrorMode | SEM_FAILCRITICALERRORS);
|
||||
HMODULE ret =
|
||||
LoadLibraryW(StringFormat::UTF82Wide(D3D12Core_Override_Path + "/d3d12core.dll").c_str());
|
||||
|
||||
SetErrorMode(prevErrorMode);
|
||||
|
||||
if(ret == NULL)
|
||||
{
|
||||
RDCERR("Can't open DLL! Wrong architecture or incompatible? system dll will be used");
|
||||
D3D12Core_Override_Path.clear();
|
||||
}
|
||||
|
||||
FreeLibrary(ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user