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

Open
github-bot wants to merge 1 commit from github-bot/gh-423 into main AGit
Owner

@⁠wike1701 on GitHub · 2026-11-27 22:15 UTC · original
wike1701:perf/bake-sources-only-pass → main · +40 −10 · 1 files · 1 commits · open

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 **
**@⁠wike1701** on GitHub · 2026-11-27 22:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/423) `wike1701:perf/bake-sources-only-pass` → `main` · +40 −10 · 1 files · 1 commits · open ## 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 **
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 22:20:01 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/423/head:github-bot/gh-423'
git switch 'github-bot/gh-423'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-423'
git switch 'github-bot/gh-423'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-423'
git switch 'github-bot/gh-423'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-423'
git switch 'main'
git merge --squash 'github-bot/gh-423'
git switch 'main'
git merge --ff-only 'github-bot/gh-423'
git switch 'main'
git merge 'github-bot/gh-423'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.