@@ -41,30 +41,6 @@ void WebGpuContext::Initialize(const WebGpuBufferCacheConfig& buffer_cache_confi
4141 std::call_once (init_flag_, [this , &buffer_cache_config, backend_type, enable_pix_capture]() {
4242 if (device_ == nullptr ) {
4343 // Create wgpu::Adapter
44- #if !defined(__wasm__) && defined(_MSC_VER) && defined(DAWN_ENABLE_D3D12) && !defined(USE_EXTERNAL_DAWN)
45- // If we are using the D3D12 backend on Windows and the build does not use external Dawn, dxil.dll and dxcompiler.dll are required.
46- //
47- // Dawn will try to load them later, but if they are in the different directory to the executable, it may fail to find them.
48- // To avoid this issue, we try to load them from the same directory as current module (usually onnxruntime.dll).
49- auto runtime_path = Env::Default ().GetRuntimePath ();
50- if (!runtime_path.empty ()) {
51- Status status;
52- void * module_handle = nullptr ;
53-
54- PathString dxil_path = runtime_path + ToPathString (L" dxil.dll" );
55- status = Env::Default ().LoadDynamicLibrary (dxil_path, false , &module_handle);
56- if (status.IsOK () && module_handle != nullptr ) {
57- modules_.Add (dxil_path, module_handle);
58- }
59-
60- PathString dxcompiler_path = runtime_path + ToPathString (L" dxcompiler.dll" );
61- status = Env::Default ().LoadDynamicLibrary (dxcompiler_path, false , &module_handle);
62- if (status.IsOK () && module_handle != nullptr ) {
63- modules_.Add (dxcompiler_path, module_handle);
64- }
65- }
66- #endif
67-
6844 wgpu::RequestAdapterOptions req_adapter_options = {};
6945 req_adapter_options.backendType = static_cast <wgpu::BackendType>(backend_type);
7046 req_adapter_options.powerPreference = wgpu::PowerPreference::HighPerformance;
0 commit comments