mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
Open driver pairs: vkd3d-proton reports the driver's caps; buffer attach/release tracing; Mesa log
- With a PanVK or RADV pair (BL_OPEN_DRIVER=1), droiddeck-game-env drops the app-wide VKD3D_FEATURE_LEVEL=12_2 and VKD3D_SHADER_MODEL=6_9 so vkd3d-proton reports what the driver has (an Unreal DX12 game crashed at start on PanVK with the overrides); a game's own setting still wins, and launch.txt records DROIDDECK_VKD3D_CAPS=driver. - The compositor traces, on a GPU that is not an Adreno, the first 400 dma-buf attaches and buffer releases by wl_buffer id and sending line, and logs any release of a buffer already released and not attached again (gamescope's "Compositor released us but we were not acquired" on G925). - Per-game logs no longer set MESA_DEBUG=silent, which kept mesa.log empty.
This commit is contained in:
1 parent
0e44b3a032
commit
d16ca4d8a8
5 files changed
+64
-5
No files matched your search
@@ -178,6 +178,15 @@ def apply_config(env, config, app_id, fixes=None):
|
||||
if dxvk:
|
||||
own = result.get("DXVK_CONFIG", "").strip().rstrip(";").strip()
|
||||
result["DXVK_CONFIG"] = own + "; " + dxvk if own else dxvk
|
||||
# An open driver pair (PanVK, RADV) on a GPU that is not an Adreno: vkd3d-proton reports the
|
||||
# driver's own feature level and shader model. The app-wide 12_2 / 6_9 over-promised what PanVK
|
||||
# has, and an Unreal DX12 game took paths that crashed. A game's own setting still wins.
|
||||
if env.get("BL_OPEN_DRIVER") == "1":
|
||||
game = config.get("games", {}).get(app_id, {}) or {}
|
||||
for name in ("VKD3D_FEATURE_LEVEL", "VKD3D_SHADER_MODEL"):
|
||||
if name not in game and name in result:
|
||||
result.pop(name)
|
||||
result["DROIDDECK_VKD3D_CAPS"] = "driver"
|
||||
return result
|
||||
|
||||
|
||||
@@ -379,7 +388,6 @@ def game_logs(command, env, app_id, now=None):
|
||||
"VKD3D_DEBUG": env.get("VKD3D_DEBUG", "warn"),
|
||||
"VKD3D_SHADER_DEBUG": env.get("VKD3D_SHADER_DEBUG", "none"),
|
||||
"MESA_LOG_FILE": str(folder / "mesa.log"),
|
||||
"MESA_DEBUG": env.get("MESA_DEBUG", "silent"),
|
||||
"PANVK_DEBUG": env.get("PANVK_DEBUG", "startup"),
|
||||
})
|
||||
try:
|
||||
@@ -389,7 +397,7 @@ def game_logs(command, env, app_id, now=None):
|
||||
"proton: %s" % command[0],
|
||||
"started: %s" % time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(now)),
|
||||
] + ["%s=%s" % (key, env[key]) for key in sorted(env)
|
||||
if key.startswith(("VK_", "BL_VK", "BL_DRM", "MESA_", "PANVK", "DXVK_", "VKD3D", "ZINK", "TU_"))]) + "\n")
|
||||
if key.startswith(("VK_", "BL_VK", "BL_DRM", "BL_OPEN", "MESA_", "PANVK", "DXVK_", "VKD3D", "ZINK", "TU_", "DROIDDECK_VKD3D"))]) + "\n")
|
||||
except OSError:
|
||||
pass
|
||||
# Whether the game's sound reaches PulseAudio: the streams 20 s and 60 s in, without waiting.
|
||||
|
||||
@@ -393,6 +393,20 @@ class GameEnvironmentTest(unittest.TestCase):
|
||||
named = game_logs(command, on, None, now=0)
|
||||
self.assertTrue(Path(named["PROTON_LOG_DIR"]).name.endswith("-Hades"))
|
||||
|
||||
def test_open_driver_pairs_report_the_drivers_own_vkd3d_caps(self):
|
||||
apply = MODULE["apply_config"]
|
||||
config = {"version": 1, "shared": {"VKD3D_FEATURE_LEVEL": "12_2", "VKD3D_SHADER_MODEL": "6_9"},
|
||||
"games": {"42": {"VKD3D_SHADER_MODEL": "6_6"}}}
|
||||
adreno = apply({}, config, "1")
|
||||
self.assertEqual(adreno["VKD3D_FEATURE_LEVEL"], "12_2")
|
||||
pair = apply({"BL_OPEN_DRIVER": "1"}, config, "1")
|
||||
self.assertNotIn("VKD3D_FEATURE_LEVEL", pair)
|
||||
self.assertNotIn("VKD3D_SHADER_MODEL", pair)
|
||||
self.assertEqual(pair["DROIDDECK_VKD3D_CAPS"], "driver")
|
||||
own = apply({"BL_OPEN_DRIVER": "1"}, config, "42")
|
||||
self.assertEqual(own["VKD3D_SHADER_MODEL"], "6_6")
|
||||
self.assertNotIn("VKD3D_FEATURE_LEVEL", own)
|
||||
|
||||
def test_game_ids_and_probes(self):
|
||||
for prefix in ("", "/compatdata/0", "/compatdata/0-123", "/compatdata/nope", "/compatdata/4294967296"):
|
||||
self.assertIsNone(MODULE["game_id"]({"STEAM_COMPAT_DATA_PATH": prefix}))
|
||||
|
||||
@@ -73,7 +73,10 @@ int __android_log_print(int, const char *, const char *, ...);
|
||||
''')
|
||||
(tmp / 'wayland-server.h').write_text('#pragma once\nstruct wl_display; struct wl_resource; struct wl_client;\n')
|
||||
compositor = (SOURCE.parent / 'compositor.c').read_text()
|
||||
callers = '\n'.join(function(compositor, n) for n in ('buffer_release_blocked', 'send_buffer_release', 'take_shm', 'take_pixel'))
|
||||
# send_buffer_release is a macro over send_buffer_release_at (with buffer tracing).
|
||||
callers = ('static void buf_trace_release(struct wl_resource *b, int line) { (void)b; (void)line; }\n'
|
||||
+ '#define send_buffer_release(b) send_buffer_release_at((b), __LINE__)\n'
|
||||
+ '\n'.join(function(compositor, n) for n in ('buffer_release_blocked', 'send_buffer_release_at', 'take_shm', 'take_pixel')))
|
||||
harness = (Path(__file__).with_name('vk_terminal_callers_test.c')).read_text()
|
||||
probe = tmp / 'probe.c'
|
||||
probe.write_text(harness.replace('/* COMPOSITOR_CALLERS */', callers))
|
||||
|
||||
Reference in new issue
Block a user