From 8913ce17365ab012f0232644fe55891aaa9664bc Mon Sep 17 00:00:00 2001 From: Tobim6 <102646588+Tobim6@users.noreply.github.com> Date: Thu, 12 Nov 2026 16:22:01 +0100 Subject: [PATCH] make_game.py: NX2NAVI_GUEST_OPT=2 builds the lifted code at -O2. With the lifted code built for the CPU's level, a profile on an RX 580 PC (Haswell-class CPU) has two game threads running it nearly all the time and the replay thread idle a quarter of the time: the game's own code bounds the frame. The lifted code is built at -O1 for build time; the environment variable NX2NAVI_GUEST_OPT=2 builds it at -O2 for a player who will wait for the longer build. Part of each object's key, so changing it rebuilds the lifted code. Co-Authored-By: Claude Opus 5.5 --- tools/make_game.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/make_game.py b/tools/make_game.py index 8698ae0d..5343e50e 100644 --- a/tools/make_game.py +++ b/tools/make_game.py @@ -1440,7 +1440,7 @@ def runtime_cmd(clang, clangxx, inc, level=0, fast=None, msys=None, first=()): cc = [str(fast), f'--sysroot={msys}'] if guest and fast else [str(clangxx if cpp else clang)] # -fdeclspec: third_party/ffx_api/ffx_api.h declares its entry points __declspec(dllexport) unconditionally declspec = ['-fdeclspec'] if cpp and not WIN else [] - return [*cc, '-c', '-std=gnu++17' if cpp else '-std=gnu11', '-O1' if guest else '-O2', + return [*cc, '-c', '-std=gnu++17' if cpp else '-std=gnu11', guest_opt if guest else '-O2', *march, '-fno-strict-aliasing', '-w', *declspec, *([] if guest else first), *inc, '-o', str(dst), str(src)] return cmd_for