File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 14
14
#include < cfgmgr32.h>
15
15
#include < devpkey.h>
16
16
#include < devguid.h>
17
+ #include < iostream>
18
+ #include < sstream>
19
+ #include < string>
17
20
18
21
namespace loader {
19
22
20
23
std::vector<DriverLibraryPath> discoverDriversBasedOnDisplayAdapters ();
21
24
22
25
std::vector<DriverLibraryPath> discoverEnabledDrivers () {
23
- return discoverDriversBasedOnDisplayAdapters ();
26
+ DWORD envBufferSize = 65535 ;
27
+ std::string altDrivers;
28
+ altDrivers.resize (envBufferSize);
29
+
30
+ // ZE_ENABLE_ALT_DRIVERS is for development/debug only
31
+ envBufferSize = GetEnvironmentVariable (" ZE_ENABLE_ALT_DRIVERS" , &altDrivers[0 ], envBufferSize);
32
+ if (!envBufferSize) {
33
+ return discoverDriversBasedOnDisplayAdapters ();
34
+ } else {
35
+ std::vector<DriverLibraryPath> enabledDrivers;
36
+ std::stringstream ss (altDrivers.c_str ());
37
+ while (ss.good ()) {
38
+ std::string substr;
39
+ getline (ss, substr, ' ,' );
40
+ enabledDrivers.emplace_back (substr);
41
+ }
42
+ return enabledDrivers;
43
+ }
44
+
24
45
}
25
46
26
47
bool isDeviceAvailable (DEVINST devnode) {
You can’t perform that action at this time.
0 commit comments