fix(steam): skip only Steam's own driver-query run in compatdata/0

Review of #1708: matching the file name alone also caught
getcompatpath for that path and a game that happens to use the name.
The wrappers now skip only "run …/d3ddriverquery64.exe" (or the 32-bit
name) with STEAM_COMPAT_DATA_PATH in compatdata/0, which is how the
client calls it; every other verb and prefix goes on to Proton.

(cherry picked from commit c5e8ad0f80)
This commit is contained in:
The412Banner committed 2026-10-28 04:42:12 +00:00
1 parent 58c262a32e
commit 4745517101
2 files changed
+25 -13

No files matched your search

@@ -276,12 +276,13 @@ bl_vacdiag() {
}
"""
# Steam's shader pre-caching runs its D3D driver query through every Proton tool at each start. Here it has never
# succeeded (exit 1 every time), and each run started Wine in compatdata/0, where the two Protons upgrade the prefix
# back and forth for many seconds while the game starts. Steam gets the same failure without starting Wine.
# Steam's shader pre-caching runs its D3D driver query through every Proton tool at each start, as
# "run <client>/bin/d3ddriverquery64.exe" in compatdata/0. Here it has never succeeded (exit 1 every time), and each
# run started Wine in compatdata/0, where the two Protons upgrade the prefix back and forth for many seconds while the
# game starts. Steam gets the same failure without starting Wine; other verbs and prefixes are left alone.
BL_DRIVER_QUERY_SKIP = """
case "${1##*/}" in
d3ddriverquery64.exe | d3ddriverquery.exe)
case "$verb:${1##*/}:${STEAM_COMPAT_DATA_PATH%/}" in
run:d3ddriverquery64.exe:*/compatdata/0 | run:d3ddriverquery.exe:*/compatdata/0)
echo "droiddeck-proton: Steam's D3D driver query is not run (it fails here and would start Wine in compatdata/0)" >&2
exit 1 ;;
esac
+19 -8
View File
@@ -859,21 +859,32 @@ class GameEnvironmentTest(unittest.TestCase):
def test_both_proton_wrappers_answer_steams_driver_query_without_wine(self):
scripts = (COMPAT["launcher_sh"](), COMPAT["extra_wrapper_sh"]("proton"))
query = "/root/.local/share/Steam/steamrtarm64/../bin/d3ddriverquery64.exe"
probe = "/root/.local/share/Steam/steamapps/compatdata/0"
for script in scripts:
subprocess.run(["bash", "-n"], input=script, text=True, check=True)
self.assertLess(script.index('case "${1##*/}" in'), script.index("bl_components "))
for args in ([query, "-d3d12"], [query], [query.replace("64.exe", ".exe")]):
self.assertLess(script.index('case "$verb:${1##*/}:'), script.index("bl_components "))
for args, prefix in (([query, "-d3d12"], probe), ([query], probe + "/"),
([query.replace("64.exe", ".exe")], probe)):
result = subprocess.run(["bash", "-s", "run"] + args, input=script, text=True, capture_output=True,
env={"PATH": os.defpath, "HOME": "/nonexistent"}, timeout=10)
env={"PATH": os.defpath, "HOME": "/nonexistent", "STEAM_COMPAT_DATA_PATH": prefix},
timeout=10)
self.assertEqual(result.returncode, 1, result.stderr)
self.assertEqual(result.stdout, "")
self.assertIn("D3D driver query is not run", result.stderr)
skip = COMPAT["BL_DRIVER_QUERY_SKIP"]
for args in (["/games/AIO/AIO-Graphics-Test-64bit.exe", "--cube", "dx11"],
["/games/Tool/tool.exe", query], ["/games/d3ddriverquery64.exe.bak"]):
out = subprocess.run(["bash", "-c", "verb=run\n" + skip + "echo continued", "_"] + args,
capture_output=True, text=True, check=True).stdout
self.assertEqual(out, "continued\n", args)
for verb, args, prefix in (
("getcompatpath", [query], probe),
("run", [query], "/root/.local/share/Steam/steamapps/compatdata/2276548447"),
("run", [query], None),
("waitforexitandrun", ["/games/AIO/AIO-Graphics-Test-64bit.exe", "--cube", "dx11"], probe),
("run", ["/games/Tool/tool.exe", query], probe),
("run", ["/games/d3ddriverquery64.exe.bak"], probe)):
env = {"PATH": os.defpath}
if prefix is not None:
env["STEAM_COMPAT_DATA_PATH"] = prefix
out = subprocess.run(["bash", "-c", "verb=" + verb + "\n" + skip + "echo continued", "_"] + args,
env=env, capture_output=True, text=True, check=True).stdout
self.assertEqual(out, "continued\n", (verb, args, prefix))
def test_wrappers_preload_the_session_library_before_the_input_shim(self):
overlay = "/root/.local/share/Steam/ubuntu12_64/gameoverlayrenderer.so"