Triforce v0.6.0 "Sage Of Power"

Faster frames (the replay's memory work, held submits, helper threads, collection and capture cuts), the game letting old areas go (QueryMemoryInfo), the 0.5.2 stutter fixed, AMD RX 5000/6000 and integrated-GPU fixes, the GPU device chosen by name, the in-game menus and launcher reworked, controller, Linux and benchmark fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-20 17:06:21 -06:00
parent b0e46adb48
commit 6c7117635c
265 changed files with 26893 additions and 2549 deletions

View File

@@ -296,10 +296,28 @@ def output_lines(p, silence):
yield line
def run(cmd, env=None, on_line=None, check=True, output=None, show=None, cwd=ROOT, base=None, silence=None):
def stop_asked(p, stop, wait):
"""A silent step asked to stop by the file `stop` (written here), given `wait` seconds to end by itself, then killed. True:
it ended by itself"""
try:
with open(stop, "wb"):
pass
except OSError:
return False
try:
p.wait(timeout=wait)
return True
except subprocess.TimeoutExpired:
return False
def run(cmd, env=None, on_line=None, check=True, output=None, show=None, cwd=ROOT, base=None, silence=None, stop=None,
stop_wait=60):
"""A step, its output printed as it comes. show: what of each line is printed (its None: nothing; on_line and a failure's
reason still get the line itself). base: the environment it starts from (os.environ). silence: seconds without a line after
which the step is stopped; it returns None then (with check, the build fails)"""
which the step is stopped; it returns None then (with check, the build fails). stop: a file the step reads as a request to
stop (the game's triforce_prepare.stop): on silence it is written first, and the step killed only if it has not ended
stop_wait seconds later"""
e = dict(os.environ if base is None else base, PYTHONIOENCODING="utf-8")
e.update(env or {})
p = subprocess.Popen(cmd, cwd=cwd, env=e, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, encoding="utf-8",
@@ -316,8 +334,9 @@ def run(cmd, env=None, on_line=None, check=True, output=None, show=None, cwd=ROO
if on_line:
on_line(line)
except Silent:
p.kill()
p.wait()
if not (stop and stop_asked(p, stop, stop_wait)):
p.kill()
p.wait()
if check:
fail("%s printed nothing for %s and was stopped" % (os.path.basename(cmd[0]), span(silence)))
return None
@@ -1046,6 +1065,11 @@ NOT_PREPARED = "the shaders were not prepared now"
# (a run that prints nothing this long is stopped. Not its whole length: that is 25 minutes on some AMD GPUs, and the driver's own
# step near the end can sit at 99% for minutes)
PREPARE_SILENCE = 15 * 60
# ((Triforce, 11-18) a silent run is asked to stop first (gpu/vk/vk_main.cpp PrepareStopWatch: it ends its driver's part
# cleanly and keeps what it made; killed, a start in that part used one of its three tries and left variants out for good),
# and killed only when it has not ended this long after)
PREPARE_STOP = "triforce_prepare.stop"
PREPARE_STOP_WAIT = 60
GAME_ENV_DROP = ("HOOKSHOT_", "PYTHON", "APPDIR", "APPIMAGE", "ARGV0", "OWD")
@@ -1084,17 +1108,24 @@ def show_prepared(line):
return line if line.startswith(("@@stage ", "@@progress ")) or not line.startswith("@@") else line[2:]
def prepare_shaders(cmd, folder=None, silence=PREPARE_SILENCE):
def prepare_shaders(cmd, folder=None, silence=PREPARE_SILENCE, stop=None, stop_wait=PREPARE_STOP_WAIT):
"""The shaders prepared now, under the builder's progress bar, not at the game's first start behind a black window (minutes on
some GPUs, issue 711): hookshot --prepare-shaders (host/hos_main.c, gpu/vk/vk_main.cpp), the same work as that first start, in
the game's folder and environment, as the builders' Play starts it. A PC whose Vulkan can't (exit 3), a run silent for `silence` seconds (then stopped), or
any other failure leaves the work to the first start, as before: never a failed build. Returns its exit code (None: stopped)"""
any other failure leaves the work to the first start, as before: never a failed build. Returns its exit code (None: stopped).
stop: the game's stop request, PREPARE_STOP beside it (a stale one is removed first, and the one written here after)"""
stop = stop or os.path.join(os.path.dirname(os.path.abspath(cmd[0])), PREPARE_STOP)
with contextlib.suppress(OSError):
os.remove(stop)
try:
code = run(cmd, check=False, show=show_prepared, cwd=folder or os.path.dirname(cmd[0]) or None,
base=game_env(), silence=silence)
base=game_env(), silence=silence, stop=stop, stop_wait=stop_wait)
except OSError as e:
not_prepared(str(e))
return 1
finally:
with contextlib.suppress(OSError):
os.remove(stop)
if code is None:
not_prepared("the game printed nothing for %s and was stopped" % span(silence))
elif code == 3:
@@ -1656,6 +1687,11 @@ def fsr_wanted(a, out):
MIT headers are in third_party/fidelityfx and its DLLs are the player's (the readme)"""
if getattr(a, "no_fsr", False):
return False
# ((Triforce) 11-20, ticket "No FSR4 option in game even though provided library apparently loaded": HOOKSHOT_FSR=1, which
# nx2/build.py and the docs name, was taken away below unless --fsr was given too, so a Linux build with it set had no FSR 4.
# Set in the environment, it asks for FSR 4 as --fsr does)
if os.environ.get("HOOKSHOT_FSR", "") == "1":
return True
return bool(getattr(a, "fsr", False)) or bool(a.update and os.path.isfile(os.path.join(out, FSR_MARK)))