mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 09:38:37 +00:00
d3d12: a typed frame generation replaces the menu's other one; the restart replays -NoFrameGen
Review ofcf15c2c6e(merzleckeier, full launcher with the final start mocked): - A saved LEONIDA_FSR_FRAMEGEN=1 undid a typed -FrameGen 2. The launcher keeps FSR 3's frame generation when both are set and drops DLSS's. The two are one choice, so -FrameGen now also sets LEONIDA_FSR_FRAMEGEN and -FsrFrameGen also sets LEONIDA_FRAME_GEN in $switchSettings. A typed one replaces the menu's other. - LEONIDA_MENU_ARGS left -NoFrameGen out, as main does, so SAVE AND RESTART turned frame generation on. It is replayed now. Tests: 12 (two new). With the launcher ofcf15c2c6e, the two new ones fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -537,9 +537,10 @@ $switchSettings = @{
|
||||
Lowest = 'LEONIDA_RENDER_SCALE', 'LEONIDA_RENDER_SCALE_MIN', 'LEONIDA_OWN_UPSCALER', 'LEONIDA_UPSCALE', 'LEONIDA_FSR_UPSCALER', 'LEONIDA_OUTPUT'
|
||||
Dlss = 'LEONIDA_RENDER_SCALE', 'LEONIDA_UPSCALE', 'LEONIDA_OWN_UPSCALER', 'LEONIDA_FSR_UPSCALER'
|
||||
NoDlss = 'LEONIDA_UPSCALE'
|
||||
FrameGen = 'LEONIDA_FRAME_GEN'
|
||||
# DLSS's and FSR 3's frame generation are one choice (never both, below): a typed one replaces the menu's other.
|
||||
FrameGen = 'LEONIDA_FRAME_GEN', 'LEONIDA_FSR_FRAMEGEN'
|
||||
NoFrameGen = 'LEONIDA_FRAME_GEN'
|
||||
FsrFrameGen = 'LEONIDA_FSR_FRAMEGEN'
|
||||
FsrFrameGen = 'LEONIDA_FSR_FRAMEGEN', 'LEONIDA_FRAME_GEN'
|
||||
Fullscreen = 'LEONIDA_FULLSCREEN'
|
||||
Aspect = 'LEONIDA_ASPECT'
|
||||
PresentScale = 'LEONIDA_PRESENT_SCALE'
|
||||
@ -667,7 +668,7 @@ $settings.LEONIDA_MENU_CONSOLE = $console
|
||||
$settings.LEONIDA_MENU_FILE = $menuFile
|
||||
$settings.LEONIDA_MENU_PLAY = $MyInvocation.MyCommand.Path
|
||||
$again = @("-Exe '$($Exe -replace "'", "''")'", "-Build $Build")
|
||||
foreach ($s in 'NoSmoothMotion', 'MotionBlur', 'NoDlss', 'SeriesX', 'Quality', 'RayTracing', 'FsrFrameGen', 'NoPrecompile', 'Log', 'Capture', 'Fullscreen') {
|
||||
foreach ($s in 'NoSmoothMotion', 'MotionBlur', 'NoDlss', 'NoFrameGen', 'SeriesX', 'Quality', 'RayTracing', 'FsrFrameGen', 'NoPrecompile', 'Log', 'Capture', 'Fullscreen') {
|
||||
if ($PSBoundParameters[$s]) { $again += "-$s" }
|
||||
}
|
||||
foreach ($s in 'Resolution', 'Lowest', 'Dlss', 'FrameGen', 'Aspect', 'PresentScale', 'Adapter', 'DlssDir', 'StreamlineDir', 'FidelityFxDir') {
|
||||
|
||||
@ -148,5 +148,39 @@ class MenuChoiceTests(unittest.TestCase):
|
||||
self.assertIn("was not updated", ran["said"])
|
||||
|
||||
|
||||
def test_a_typed_frame_generation_replaces_the_menus_other_one(self):
|
||||
# DLSS's and FSR 3's are one choice: the launcher keeps FSR 3's when both are set, so a saved FSR 3 would
|
||||
# undo a typed -FrameGen.
|
||||
self.menu.write_text("LEONIDA_FSR_FRAMEGEN=1\r\nLEONIDA_PANEL=1\r\n", encoding="utf-8")
|
||||
ran = self.start({"LEONIDA_FRAME_GEN": "2"}, typed=["FrameGen"])
|
||||
self.assertEqual(ran["settings"]["LEONIDA_FRAME_GEN"], "2")
|
||||
self.assertNotIn("LEONIDA_FSR_FRAMEGEN", ran["settings"])
|
||||
self.assertEqual(self.saved(), {"LEONIDA_PANEL": "1"})
|
||||
self.menu.write_text("LEONIDA_FRAME_GEN=3\r\n", encoding="utf-8")
|
||||
ran = self.start({"LEONIDA_FSR_FRAMEGEN": "1"}, typed=["FsrFrameGen"])
|
||||
self.assertEqual(ran["settings"]["LEONIDA_FSR_FRAMEGEN"], "1")
|
||||
self.assertNotIn("LEONIDA_FRAME_GEN", ran["settings"])
|
||||
self.assertEqual(self.saved(), {})
|
||||
|
||||
|
||||
@unittest.skipUnless(os.name == "nt", "Windows PowerShell launcher")
|
||||
class MenuRestartArgsTests(unittest.TestCase):
|
||||
def test_the_restart_replays_every_frame_generation_switch(self):
|
||||
"""The menu's SAVE AND RESTART starts the launcher again with LEONIDA_MENU_ARGS: a switch left out of it is
|
||||
lost on that start (-NoFrameGen was, and the restart turned frame generation on)."""
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
exe = Path(tmp) / "title.exe"
|
||||
exe.write_bytes(b"")
|
||||
res = subprocess.run(
|
||||
["powershell.exe", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", str(SCRIPT),
|
||||
"-Exe", str(exe), "-SeriesX", "-Lowest", "1080", "-NoFrameGen", "-FsrFrameGen", "-DryRun"],
|
||||
capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=120,
|
||||
)
|
||||
self.assertEqual(res.returncode, 0, res.stderr)
|
||||
args = next(l for l in res.stdout.splitlines() if l.startswith("LEONIDA_MENU_ARGS="))
|
||||
for switch in ("-NoFrameGen", "-FsrFrameGen", "-SeriesX", "-Lowest '1080'", "-MenuRestart"):
|
||||
self.assertIn(switch, args)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user