build: keep release optimisation (-O2) instead of forcing -Og

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.
This commit is contained in:
James Dansereau committed 2026-09-03 00:18:45 -04:00
1 parent a0ba900d48
commit 7549570bb5
1 file changed
+5 -1
+5 -1
View File
@@ -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()