@@ -80,8 +80,8 @@ class StreamlineProxy
8080 State::DisableChecks (owner);
8181 }
8282
83- std::filesystem::path localSlPath (Config::Instance ()->MainDllPath .value ());
84- localSlPath = localSlPath / L" streamline" ; // Hardcoded streamline folder
83+ std::filesystem::path mainDllPath (Config::Instance ()->MainDllPath .value ());
84+ std::filesystem::path localSlPath = mainDllPath / L" streamline" ; // Hardcoded streamline folder
8585
8686 std::filesystem::path slInterposerPath = localSlPath / L" sl.interposer.dll" ;
8787 LOG_INFO (L" Trying to load sl.interposer.dll from dll path: {}" , slInterposerPath.wstring ());
@@ -94,7 +94,15 @@ class StreamlineProxy
9494 State::Instance ().optiSlInterposer = _dll;
9595 auto slCommonPath = localSlPath / L" sl.common.dll" ;
9696 State::Instance ().optiSlCommon = NtdllProxy::LoadLibraryExW_Ldr (slCommonPath.c_str (), NULL , NULL );
97- auto dlssgPath = localSlPath / L" nvngx_dlssg.dll" ; // TODO: maybe some search?
97+
98+ // Release bundles place NVIDIA NGX snippets directly under OptiScaler\,
99+ // while Streamline itself lives under OptiScaler\streamline\.
100+ // Prefer the bundled DLSS-G snippet so the local Streamline 2.14 instance
101+ // cannot silently fall back to an older game/driver copy.
102+ auto dlssgPath = mainDllPath / L" nvngx_dlssg.dll" ;
103+ if (!std::filesystem::exists (dlssgPath))
104+ dlssgPath = localSlPath / L" nvngx_dlssg.dll" ; // legacy/manual layout fallback
105+
98106 State::Instance ().optiDLSSG = NtdllProxy::LoadLibraryExW_Ldr (dlssgPath.c_str (), NULL , NULL );
99107
100108 return HookStreamline (_dll);
@@ -315,14 +323,34 @@ class StreamlineProxy
315323 pref.flags &= ~sl::PreferenceFlags::eLoadDownloadedPlugins;
316324
317325 auto exePath = Util::ExePath ().remove_filename ();
318- auto nvngxDlssPath = Util::FindFilePath (exePath, " nvngx_dlss.dll" );
319- auto nvngxDlssDPath = Util::FindFilePath (exePath, " nvngx_dlssd.dll" );
320- auto nvngxDlssGPath = Util::FindFilePath (exePath, " nvngx_dlssg.dll" );
326+ std::filesystem::path mainDllPath (Config::Instance ()->MainDllPath .value ());
327+
328+ // Prefer the runtime shipped with this build. Searching from the exe first
329+ // can select the game's older DLSS copy before OptiScaler's bundled 310.9.
330+ auto findBundledNgxFirst = [&](const std::filesystem::path& fileName)
331+ -> std::optional<std::filesystem::path>
332+ {
333+ auto direct = mainDllPath / fileName;
334+ if (std::filesystem::exists (direct) && std::filesystem::is_regular_file (direct))
335+ {
336+ LOG_INFO (L" Using bundled {} from {}" , fileName.wstring (), direct.wstring ());
337+ return direct;
338+ }
339+
340+ if (auto bundled = Util::FindFilePath (mainDllPath, fileName); bundled.has_value ())
341+ return bundled;
342+
343+ return Util::FindFilePath (exePath, fileName);
344+ };
345+
346+ auto nvngxDlssPath = findBundledNgxFirst (L" nvngx_dlss.dll" );
347+ auto nvngxDlssDPath = findBundledNgxFirst (L" nvngx_dlssd.dll" );
348+ auto nvngxDlssGPath = findBundledNgxFirst (L" nvngx_dlssg.dll" );
321349
322350 std::vector<std::wstring> pathStorage;
323351
324- std::filesystem::path mainDllPath ( Config::Instance ()-> MainDllPath . value ()) ;
325- mainDllPath = mainDllPath / L" streamline " ;
352+ std::filesystem::path localSlPath = mainDllPath / L" streamline " ;
353+ pathStorage. push_back (localSlPath. wstring ()) ;
326354 pathStorage.push_back (mainDllPath.wstring ());
327355
328356 if (nvngxDlssGPath.has_value ())
0 commit comments