toolchain: build proxy and launcher with SSE2 math; run-trio.sh paths from $HOME

i686 GCC defaults to x87 floating point; MSVC x86 defaults to SSE2 and x87 is the
slow path under FEX. Add -msse2 -mfpmath=sse -mstackrealign (the game calls in
with 4-byte stack alignment) to the proxy and launcher flags. The DXVK fork's
meson.build already passes -msse -msse2 -msse3 -mfpmath=sse. d3d9.dll x87
instructions 80809 -> 3627, SSE 0 -> 67940.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
simplysanatoriandClaude Sonnet 5.5 committed 2026-10-28 03:04:35 -04:00
1 parent 654619ffaf
commit c3cbff86e0
2 files changed
+7 -5

No files matched your search

+5 -2
View File
@@ -55,7 +55,10 @@ if [ "$WHAT" = all ] || [ "$WHAT" = proxy ]; then
DEFS=$(grep -E '^set CFLAGS=' /src/build.bat | grep -oE '/D[A-Za-z_0-9]+' | sed 's#^/D#-D#' | tr '\n' ' ')
INC="-I$W/third_party/openvr/headers -I$W/third_party/openxr/include -I$W/third_party/imgui -I/src/dxvk-trlvr/src/d3d9 -I/src/dxvk-trlvr/include/vulkan/include"
# -include seh_compat.h: MSVC __try/__except shim + _ReturnAddress + sret helper; sources stay unmodified.
CXXFLAGS="-std=gnu++17 -O2 $DEFS -fno-strict-aliasing -include /shims/seh_compat.h $INC ${EXTRA_CXXFLAGS:-}"
# MSVC x86 defaults to SSE2 math; i686 GCC defaults to x87, which is slow under FEX. -mstackrealign:
# the game (MSVC, 4-byte stack alignment) calls into the proxy, and GCC's SSE spills assume 16.
FPFLAGS="-msse2 -mfpmath=sse -mstackrealign"
CXXFLAGS="-std=gnu++17 -O2 $FPFLAGS $DEFS -fno-strict-aliasing -include /shims/seh_compat.h $INC ${EXTRA_CXXFLAGS:-}"
echo "sources: $(echo $SRCS $IMGUI_SRCS | wc -w); defs: $DEFS"
objs=(); pids=()
for s in $SRCS $IMGUI_SRCS; do
@@ -79,7 +82,7 @@ if [ "$WHAT" = all ] || [ "$WHAT" = proxy ]; then
-Wl,-Map,/out/dist/d3d9.map \
-ldxguid -luser32 -lkernel32 -ladvapi32 -lgdi32 -ldwmapi ${EXTRA_LIBS:-}
# Launcher: its own exe (large-address-aware bit must be in the file).
i686-w64-mingw32-g++ -std=gnu++17 -O2 -DWIN32 -DNDEBUG -D_CRT_SECURE_NO_WARNINGS \
i686-w64-mingw32-g++ -std=gnu++17 -O2 $FPFLAGS -DWIN32 -DNDEBUG -D_CRT_SECURE_NO_WARNINGS \
-include /shims/seh_compat.h -static -static-libgcc -static-libstdc++ -s \
-o /out/dist/trlvr_launcher.exe "$W/src/launcher/main.cpp" \
-mwindows -municode -Wl,--large-address-aware -luser32 -lkernel32 -lshell32
+2 -3
View File
@@ -2,11 +2,10 @@
# usage: run-trio.sh <label> <dist dir> [key=value ini overrides...]
# Swaps the trio into the game dir, launches headless-style (DISPLAY=:1, 90 s), kills, restores.
LABEL=$1; DIST=$(readlink -f $2); shift 2
G="/home/steamos/.local/share/Steam/steamapps/common/Tomb Raider Legend"; ST=/home/steamos/.local/share/Steam
B=/home/steamos/Games/LegendFrame/build-m1; L=$B/logs/$LABEL; mkdir -p $L
G="$HOME/.local/share/Steam/steamapps/common/Tomb Raider Legend"; ST=$HOME/.local/share/Steam
B=$HOME/Games/LegendFrame/build-m1; L=$B/logs/$LABEL; mkdir -p $L
pgrep trl_vr && { echo "game running"; exit 1; }
# verify shipped state
(cd $B/shipped/1.0.0 && grep -E " (d3d9.dll|d3d9_dxvk.dll|trlvr_launcher.exe|openvr_api.dll|trl_vr.exe)$" SHA256SUMS | sed "s# # $G/#;s# *$G/# $G/#" >/dev/null)
for f in d3d9.dll d3d9_dxvk.dll trlvr_launcher.exe; do
want=$(grep " $f\$" $B/shipped/1.0.0/SHA256SUMS | cut -d' ' -f1); have=$(sha256sum "$G/$f" | cut -d' ' -f1)
[ "$want" = "$have" ] || { echo "game-dir $f is not the shipped one; abort"; exit 2; }