Launcher under Wine/Proton writes model paths the game's own prefix can't reach (C: instead of Z:)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
The issue says the change and tests already exist on the author's fork in commit 51f28a4, with UnderWine() from commit 35077de as a dependency. Before starting, compare those commits with wg_core/util.cpp and install.cpp and coordinate with the author, who offers to open a PR. If work is still needed, run wg_core_tests under Wine and check that game settings use reachable Z: paths while non-Wine paths remain unchanged.
由索引模型根据 Issue 内容生成。
描述
What happens
On Linux, players run the launcher under Wine, while Steam's Proton runs each game in a Wine prefix of its own. The launcher writes two paths into the game's settings:
model_dir(wronggpu.ini);rr_model(wronggpu-rr.ini).
Both are written as C:\users\<user>\AppData\Local\WrongGPU\model... paths of the launcher's own prefix. The game's prefix has a different C:, so Model M and Ray Reconstruction find no model there.
Suggested fix
Under Wine, write those two paths as Z: paths: Z: maps the Linux root in every prefix, so the game reaches the same files.
- Wine's
kernel32exportswine_get_unix_file_name, which gives the Linux name of a DOS path. - It fails when more than the last part of the path doesn't exist yet (the RR data's
F\folder before its first conversion). So convert the deepest folder that exists and append the rest. - A
model_dirthe player set stays as it is. - Detecting Wine:
GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "wine_get_version") != nullptr.
The core of it, as I tested it (wg_core/util.cpp):
wstring PathForGamePrefix(const wstring& path) {
if (path.empty() || !UnderWine()) return path;
using UnixNameFn = char*(CDECL*)(const wchar_t*);
auto unixName = reinterpret_cast<UnixNameFn>(reinterpret_cast<void*>(
GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "wine_get_unix_file_name")));
if (!unixName) return path;
wstring head = path, tail;
char* u = nullptr;
while (!(u = unixName(head.c_str()))) { // missing folders: walk up, keep the tail
const size_t cut = head.find_last_of(L"\\/");
if (cut == wstring::npos || cut < 3) return path;
tail = head.substr(cut) + tail;
head.resize(cut);
}
wstring z = L"Z:" + FromUtf8(u) + tail;
HeapFree(GetProcessHeap(), 0, u); // Wine allocates it on the process heap
for (wchar_t& c : z) if (c == L'/') c = L'\\';
return z;
}
install.cpp then writes model_dir = PathForGamePrefix(ModelBaseDir()) under Wine when the player set none, and RrIniText(PathForGamePrefix(RrDataFile())). Outside Wine nothing changes: the function returns the path unchanged.
How it was tested (synthetic data only)
wg_core_testsunder GE-Proton 11-11's Wine (llvm-mingw build): the path names the same file, and a path with two missing folders still becomes aZ:path with its tail kept. Outside Wine the path is unchanged. The missing-folder check failed with the walk-up taken out.- Launcher installs into generated test games, started with
proton runon a new empty prefix under GE-Proton 11-11, Proton 11.0 and Proton-CachyOS, wrotemodel_dir=Z:\...andrr_model=Z:\...\F\model.wgcm. - Not run on Windows.
The change with its tests is in PR #105: commit 1b024cf, which needs only 677af52 (UnderWine()).
Related: #10.
- 主要语言
- C++
- 星标
- 12
- 派生
- 2
- 平均合并
- 3 小时 10 分钟
- 30 天内合并 PR
- 171
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
phantoslayer21/wronggpu 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
phantoslayer21/wronggpu#275 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
phantoslayer21/wronggpu#274 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
phantoslayer21/wronggpu#241 ·
维护者通常 1 天内回复
-
bug build
难度 2/5 1-3 小时 新手友好度 74/100
phantoslayer21/wronggpu#234 ·
维护者通常 1 天内回复
-
bug build
难度 2/5 1-3 小时 新手友好度 80/100
phantoslayer21/wronggpu#233 ·
维护者通常 1 天内回复
查看 phantoslayer21/wronggpu 的全部 Issue
相似的 Issue
-
ai_p2
难度 2/5 1-3 小时 新手友好度 80/100
ClickHouse/ClickHouse#132519 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
juce-framework/JUCE#1810 ·
-
难度 1/5 1 小时以内 新手友好度 82/100
petercorke/robotics-toolbox-python#952 ·
维护者通常 1 天内回复
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit status未关闭func:engine type:bug
难度 2/5 1-3 小时 新手友好度 72/100
NatronGitHub/Natron#1276 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复