Play-VIctory-AMD: port 1 on with batched clamps on CPUs of 16 threads or fewer (#180, #171)

With port 1 off, an 8-core 5700X3D lost more on CPU copies than the card
gained (16.2 -> 14.4 fps); with port 1 on and its clamps batched after the
last buffer-writing shader, the GPU went 42.6 -> 26 ms and 16.8 -> 18-19 fps.
Larger CPUs keep port 1 off. An explicit VICTORY_PORT_CONSTANTS still wins.
This commit is contained in:
DoubleGhosty
2026-12-01 10:50:29 +01:00
parent 2572553724
commit 7b56d2d4d0
2 changed files with 15 additions and 3 deletions

View File

@ -54,7 +54,19 @@ rem ~6 ms on an RTX 5070 Ti, but on AMD every indirect execution is clamped afte
rem each shader write before it, and outdoors the frame rate doubled without it:
rem RX 9070 XT 8-10 -> 20-21 fps (#180), RX 7800 XT 5-7 -> 16 (#181),
rem RX 7900 XTX 7-12 -> ~12 (#171). set VICTORY_PORT_CONSTANTS=1 to compare.
if not defined VICTORY_PORT_CONSTANTS set "VICTORY_PORT_CONSTANTS=0"
rem But with port 1 off, the copies come back to the CPU: on 8 cores or fewer
rem (16 threads) that costs more than it saves (RX 7800 XT + 5700X3D: 16.2 -> 14.4
rem fps, #180). There, port 1 stays on and its clamps run in a batch after the
rem last buffer-writing shader instead of one by one (GPU 42.6 -> 26 ms, 16.8 ->
rem 18-19 fps, #180), which is what made port 1 slow on AMD.
if not defined VICTORY_PORT_CONSTANTS (
if %NUMBER_OF_PROCESSORS% LEQ 16 (
set "VICTORY_PORT_CONSTANTS=1"
if not defined VICTORY_PORT_CONSTANTS_ORDER_ALONE set "VICTORY_PORT_CONSTANTS_ORDER_ALONE=0"
) else (
set "VICTORY_PORT_CONSTANTS=0"
)
)
rem Port 5: constant buffers read as raw bytes (~4.7 ms, ~22k fills eliminated).
if not defined VICTORY_PORT_CBV set "VICTORY_PORT_CBV=1"
rem Port 6: write-guard lock shared by faults and refreshes (~2 ms saved).

View File

@ -75,7 +75,7 @@ gh attestation verify .\cool_fox-windows-x64.zip -R DoubleGhosty/cool_fox
- Every launcher holds the game's 30 s watchdog (`VICTORY_POKE`) so slow first frames don't end the run.
- **Renderer Ports (Performance):**
- `VICTORY_PORT_GUARD=1` and `VICTORY_PORT_JOURNAL=1` now enabled by default in launchers: write-guard lock sharing and journal splitting save 2–5 ms per frame on all tested GPUs.
- `VICTORY_PORT_CBV=1` (port 5) is on in `Play-VIctory-AMD.cmd` and opt-in elsewhere. `VICTORY_PORT_CONSTANTS=1` (port 1) is opt-in everywhere: on AMD cards it halves the frame rate outdoors (#180, #181, #171).
- `VICTORY_PORT_CBV=1` (port 5) is on in `Play-VIctory-AMD.cmd` and opt-in elsewhere. `VICTORY_PORT_CONSTANTS=1` (port 1) is opt-in everywhere except `Play-VIctory-AMD.cmd` on CPUs of 16 threads or fewer, where it is on with its clamps batched (`VICTORY_PORT_CONSTANTS_ORDER_ALONE=0`): with clamps one by one it halves AMD frame rates outdoors (#180, #181, #171), and with port 1 off an 8-core CPU loses more on copies than the card gains (#180).
- `VICTORY_LEVELS_ON_DEMAND=1` enabled by default: card memory allocated only for texture mip levels the title holds, saving up to 3 GB of VRAM.
---
@ -192,7 +192,7 @@ Each renderer port eliminates a class of per-frame CPU work. "Default" is what t
| Port | Switch | What it does | Saving | Default |
|---|---|---|---|---|
| 1 | `VICTORY_PORT_CONSTANTS=1` | Title's 174 MB constants heap read in place by the card; no uploads or fills | ~6 ms on an RTX 5070 Ti; on AMD it halves the frame rate outdoors (#180) | Off everywhere (8 GB NVIDIA: C++ exception #15; AMD: #180) |
| 1 | `VICTORY_PORT_CONSTANTS=1` | Title's 174 MB constants heap read in place by the card; no uploads or fills | ~6 ms on an RTX 5070 Ti; on AMD it halves the frame rate outdoors (#180) | Off, except the AMD launcher on ≤16 threads with batched clamps (8 GB NVIDIA: C++ exception #15; AMD: #180) |
| 5 | `VICTORY_PORT_CBV=1` | Constant buffers read as raw bytes; ~22,000 fills/frame eliminated | ~4.7 ms | On in `Play-VIctory-AMD.cmd`; off elsewhere (8 GB NVIDIA: dropped surfaces) |
| 6 | `VICTORY_PORT_GUARD=1` | Write-guard lock shared by faults and refreshes, one claim per 64 KiB block | ~2 ms | **On** |
| 7 | `VICTORY_PORT_JOURNAL=1` | Journal notes split into 64 parts with their own locks; heaps synced at submit | ~1–3 ms | **On** |