mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-25 18:48:51 -04:00
Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
48 lines
2.2 KiB
Python
48 lines
2.2 KiB
Python
"""Run production present route/geometry diagnostics and bounded per-kind state tracking without a GPU."""
|
|
import argparse
|
|
from pathlib import Path
|
|
import os
|
|
import subprocess
|
|
import tempfile
|
|
|
|
RUN_ALL_ARGS = ["--cxx", "{cxx}"]
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def main():
|
|
p = argparse.ArgumentParser(description=__doc__)
|
|
p.add_argument("--cxx", default="g++")
|
|
p.add_argument("--source", type=Path, default=ROOT)
|
|
a = p.parse_args()
|
|
source = (a.source / "gpu/vk/vk_replay.cpp").read_text(encoding="utf-8")
|
|
begin = source.index("void present_image(")
|
|
marker = " const PresentAspect aspect{" if " const PresentAspect aspect{" in source[begin:] else " const bool preserve_stretch ="
|
|
start = source.index(marker, begin)
|
|
end = source.index(" // ((Triforce) RX_VK_FRAMELOG_WINDOW=1, with the frame log:", start)
|
|
draw = source[start:end]
|
|
trace = ""
|
|
if " // Geometry trace:" in source[end:]:
|
|
start = source.index(" // Geometry trace:", end)
|
|
stop = source.index(" menu_record(", start)
|
|
# (Triforce: the device lost's marker before the menu, wp8-lost, is not the trace's)
|
|
marked = source.find(" checkpoint_mark(f.cmd, index, 'M');", start)
|
|
trace = source[start:marked if 0 <= marked < stop else stop]
|
|
fixture = (ROOT / "tests/present_geometry_trace_test.cpp").read_text(encoding="utf-8")
|
|
fixture = fixture.replace("/* ACTUAL_DRAW */", draw).replace("/* ACTUAL_TRACE */", trace)
|
|
with tempfile.TemporaryDirectory(prefix="present-geometry-trace-") as temp:
|
|
cpp, exe = Path(temp) / "fixture.cpp", Path(temp) / "fixture.exe"
|
|
cpp.write_text(fixture, encoding="utf-8")
|
|
subprocess.run([a.cxx, "-std=c++20", "-Wall", "-Wextra", "-Werror", "-I" + str(a.source / "gpu/vk"),
|
|
str(cpp), "-o", str(exe)], check=True)
|
|
for value in (None, "0", "1"):
|
|
env = os.environ.copy()
|
|
env.pop("RX_VK_PRESENT_LOG", None)
|
|
if value is not None:
|
|
env["RX_VK_PRESENT_LOG"] = value
|
|
subprocess.run([str(exe), "1" if value == "1" else "0"], env=env, check=True, timeout=30)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|