Skip to content

Commit 4340889

Browse files
committed
fix: prefer bundled DLSS 310.9 and Streamline 2.14
1 parent 1490a63 commit 4340889

2 files changed

Lines changed: 49 additions & 9 deletions

File tree

‎.github/workflows/just_build_no_signature.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,19 @@ jobs:
115115
- name: Add the readme
116116
run: Copy-Item ${{ github.workspace }}\dist\README.md ${{ github.workspace }}\x64\Release\a\README.md
117117

118-
# Cut before the redistributables land, so this archive carries the loader alone.
118+
# Always stage the validated runtime set before creating the normal artifact.
119+
# This prevents the default download from silently falling back to the game's
120+
# older DLSS / Streamline copies.
121+
- name: Add Streamline to default artifact
122+
run: |
123+
$target = "${{ github.workspace }}\x64\Release\a\OptiScaler\streamline"
124+
New-Item -ItemType Directory -Force -Path $target | Out-Null
125+
Copy-Item ${{ github.workspace }}\dist\streamline\* $target
126+
127+
- name: Add NGX snippets to default artifact
128+
run: Copy-Item ${{ github.workspace }}\dist\nvngx\* ${{ github.workspace }}\x64\Release\a\OptiScaler\
129+
130+
# The normal artifact is now the full DLSS 310.9 + Streamline 2.14 bundle.
119131
- name: Compress the artifact
120132
run: |
121133
$zipName = "${{ steps.get_version.outputs.filename }}.7z"

‎OptiScaler/proxies/Streamline_Proxy.h‎

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)