11#include " dxc/Support/dxcapi.use.h"
22#include " dxc/dxcapi.h"
33
4- using dxc::DxcDllSupport;
5-
6- class DxcDllExtValidationSupport : public DxcDllSupport {
4+ class DxcDllExtValidationSupport : public dxc ::DxcDllSupport {
75 // DxcDllExtValidationSupport manages the
86 // lifetime of dxcompiler.dll, while the member, m_DxilSupport,
97 // manages the lifetime of dxil.dll
10- DxcDllSupport m_DxilSupport;
8+ dxc:: DxcDllSupport m_DxilSupport;
119
1210 std::string DxilDllPath;
1311 // override DxcDllSupport's implementation of InitializeInternal,
1412 // adding the environment variable value check for a path to a dxil.dll
15- HRESULT InitializeInternal (LPCSTR dllName, LPCSTR fnName);
1613
1714 std::string GetDxilDLLPathExt () { return DxilDllPath; }
1815 bool DxilDllSuccessfullyLoaded () {
1916 return !DxilDllPath.empty () && !m_DxilSupport.IsEnabled ();
2017 }
2118
22- HRESULT InitializeInternal (LPCSTR dllName, LPCSTR fnName) {
23- // Load dxcompiler.dll
24- HRESULT result = InitializeForDll (dllName, fnName);
25- // if dxcompiler.dll fails to load, then we won't try loading dxil.dll,
26- // so set this boolean to false.
27-
28- // now handle external dxil.dll
29- const char *envVal = std::getenv (" DXC_DXIL_DLL_PATH" );
30- bool ValidateInternally = false ;
31- if (!envVal || std::string (envVal).empty ()) {
32- return S_OK;
33- }
34-
35- std::string DllPathStr (envVal);
36- DxilDllPath = DllPathStr;
37- std::filesystem::path DllPath (DllPathStr);
38-
39- // Check if path is absolute and exists
40- if (!DllPath.is_absolute () || !std::filesystem::exists (DllPath)) {
41- return S_OK;
42- }
43- // code that calls this function is responsible for checking
44- // to see if dxil.dll is successfully loaded.
45- // the CheckDxilDLLLoaded function can determine whether there were any
46- // problems loading dxil.dll or not
47- m_DxilSupport.InitializeForDll (DllPathStr.data (), fnName);
48-
49- return S_OK;
50- }
19+ HRESULT InitializeInternal (LPCSTR dllName, LPCSTR fnName);
5120};
0 commit comments