perf(gpu): skip 1500 ms synchronous full-heap texture pass before bakes when VICTORY_BAKE_SOURCES is on #423

Merged
wike1701 merged 1 commit from upstream-pr/423 into main 2026-11-28 19:39:39 +00:00
wike1701 commented 2026-11-27 22:15:57 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by wike1701 on 2026-11-27T22:15:57Z.


Problem

In open-world gameplay, every time an NPC or vehicle spawns and runs a decoration bake draw, State::early_textures runs self.heap_textures(bake_list, ...) synchronously with a default budget of 1,500 ms / 2 GiB (VICTORY_BAKE_TEXTURES_MS=1500) and then blocks on gpu.execute_sync_internal(bake_list).

In real open-world captures on an RTX 5060 Ti 16 GB, this caused 500–1,850 ms freezes every 5 seconds (2 before bakes (1850 ms), 5 before bakes (1122 ms), 9 before bakes (1003 ms), 2.6 fps / 385 ms/frame), even though State::bring_bake_sources() (VICTORY_BAKE_SOURCES=1, on by default) already scans the bake draw's exact texture references and uploads all of them synchronously (akes=256, sources=2899, failed=0).

Setting VICTORY_BAKE_TEXTURES_MS=0 previously disabled is_bake altogether, which also disabled ring_bake_sources.

Fix

  • Decouple is_bake from ake_ms > 0: early_textures now enters the synchronous bake path whenever ake_ms > 0 || bake_sources_on().
  • Default VICTORY_BAKE_TEXTURES_MS to **
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5533797945 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/423). Originally posted by [wike1701](https://github.com/wike1701) on 2026-11-27T22:15:57Z. --- ## Problem In open-world gameplay, every time an NPC or vehicle spawns and runs a decoration bake draw, State::early_textures runs self.heap_textures(bake_list, ...) synchronously with a default budget of **1,500 ms / 2 GiB** (VICTORY_BAKE_TEXTURES_MS=1500) and then blocks on gpu.execute_sync_internal(bake_list). In real open-world captures on an RTX 5060 Ti 16 GB, this caused **500–1,850 ms freezes every 5 seconds** (2 before bakes (1850 ms), 5 before bakes (1122 ms), 9 before bakes (1003 ms), 2.6 fps / 385 ms/frame), even though State::bring_bake_sources() (VICTORY_BAKE_SOURCES=1, on by default) already scans the bake draw's exact texture references and uploads all of them synchronously (akes=256, sources=2899, failed=0). Setting VICTORY_BAKE_TEXTURES_MS=0 previously disabled is_bake altogether, which also disabled ring_bake_sources. ## Fix - Decouple is_bake from ake_ms > 0: early_textures now enters the synchronous bake path whenever ake_ms > 0 || bake_sources_on(). - Default VICTORY_BAKE_TEXTURES_MS to **
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!423
No description provided.