Files
UnrealEngineUWP/Engine/Source/Runtime/Windows
paul chipchase b702542294 Prevent a crash in DX12 if GFSDK_Aftermath_Lib.x64.dll is not found and improve the finding of the dll when using -basedir=
#rb kenzo.terelst
#preflight 60c9ebb93e1b3c0001400246

- The original code is using ::LoadLibrary with a relative path to find the dll and when running from staged data via -basedir= we will be relying on that path being relative to the current directory set by the command line. However many modules call FPlatformProcess::PushDllDirectory/PopDllDirectory to find dlls and when all of the paths are fully popped we will call ::SetDllDirectory with an empty string which will remove the current directory from the list of valid paths for ::LoadLibrary to search.
- To fix this we can call FPlatformProcess::PushDllDirectory/PopDllDirectory ourselves, with the location of the dll and then request the handle of the dll instead (examples of this can be found in other modules)
- When running with DX12 we no longer attempt to enable NvAftermath if we previously failed to find the dll in order to prevent a crash. We do this by recording if the dll has been loaded or not via a new global variable GDX12NVAfterMathModuleLoaded, similar to how the DX11 code path tracks this.

[CL 16690777 by paul chipchase in ue5-main branch]
2021-06-16 12:54:07 -04:00
..