mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 21:06:09 +00:00
fix(game-env): OpenGL games stop waiting for each screen refresh (#1715)
With no frame limit, AIO's Direct3D 7 (DirectDraw) test ran at exactly 144 fps on a 144 Hz panel: every frame waited one refresh (6.94 ms). Wine asks for a swap interval of 1 on every OpenGL window, and WineD3D's front-buffer drawing used by DirectDraw and Direct3D 1-7 never lowers it; it only sets the interval in its present path. Mesa's Zink then presents in FIFO. droiddeck-game-env sets vblank_mode=0 for games launched through Proton before the game's environment edits, so a value set in the launch options or the editor wins and an editor Remove leaves Mesa's default. Steam's own runs in compatdata/0 are unchanged. Steam's Frame Limit still holds a game: gamescope's WSI layer presents every swapchain in FIFO while its limiter is on. On the AYANEO Pocket FIT, AIO Direct3D 7 went from 144 to 2,345 and 2,265 fps (1 % low 99 -> 620) with no limit; with the Quick Access limit at 144 and 72 it held at 143.76 and 71.92.
This commit is contained in:
1 parent
213c2da57e
commit
9d82df6981
4 files changed
+58
-1
No files matched your search
@@ -432,6 +432,16 @@ def cpu_topology(env, command=()):
|
||||
print("droiddeck-game-env: Windows sees %d cores (%s)" % (len(cores), env["WINE_CPU_TOPOLOGY"]), file=sys.stderr)
|
||||
|
||||
|
||||
def gl_vsync(env):
|
||||
"""OpenGL stops waiting for each screen refresh; Steam's Frame Limit still holds the game through gamescope."""
|
||||
# Wine asks for interval 1 on every GL window, and WineD3D's front-buffer drawing (DirectDraw,
|
||||
# Direct3D 1-7) never lowers it, so those games ran at the refresh rate with no limit set.
|
||||
if "vblank_mode" in env or game_id(env) is None:
|
||||
return False
|
||||
env["vblank_mode"] = "0"
|
||||
return True
|
||||
|
||||
|
||||
def apply_config(env, config, app_id, fixes=None):
|
||||
if config.get("version") != 1:
|
||||
raise ValueError("unsupported environment configuration")
|
||||
@@ -729,6 +739,7 @@ def main():
|
||||
digest = None
|
||||
app_id = game_id(env)
|
||||
if app_id:
|
||||
gl_default = gl_vsync(env)
|
||||
waiting = len(command) > 1 and command[1] == "waitforexitandrun"
|
||||
fixes = {}
|
||||
if waiting:
|
||||
@@ -761,6 +772,8 @@ def main():
|
||||
env = apply_game_debug_logs(env, config, debug_dir)
|
||||
if env is not before_debug:
|
||||
print("droiddeck-game-env: game debug logs enabled for this launch", file=sys.stderr)
|
||||
if gl_default and env.get("vblank_mode") == "0":
|
||||
print("droiddeck-game-env: OpenGL does not wait for the screen refresh (vblank_mode=0)", file=sys.stderr)
|
||||
if app_id and len(command) > 1 and command[1] == "waitforexitandrun":
|
||||
command = offline_without_anticheat(command, env)
|
||||
if mic_enabled == "0":
|
||||
|
||||
Reference in new issue
Block a user