From 7549570bb504714571535d69864fda6957cdb05a Mon Sep 17 00:00:00 2001 From: James Dansereau <106631954+jkdansereau@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:31:44 -0400 Subject: [PATCH] build: keep release optimisation (-O2) instead of forcing -Og MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The non-Debug branch unconditionally appended -Og, which (last -O wins) overrode RelWithDebInfo's -O2 for every TU. -Og is a ~10% frame-time regression on the software RSP/rasteriser hot path and is not what a release/playtest build wants. Restrict -Og to explicit Debug builds. Note: does NOT fix the ~1 fps issue under investigation — the software renderer is ~950 ms/frame at both -Og and -O2 on this box; this is just the correct default. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eaee9923..afb4d1d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -225,7 +225,11 @@ add_compile_options( # get a real backtrace of a hung/crashed game thread. add_compile_options(-fno-omit-frame-pointer) -if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") +# Optimisation: the software RSP + software rasteriser in port/fast3d are the +# hot path and are very sensitive to -O level (the difference between ~1 fps +# and playable). Non-Debug builds keep the CMAKE_BUILD_TYPE optimisation +# (RelWithDebInfo => -O2); only an explicit Debug build drops to -Og. +if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_compile_options(-Og) endif()