draw: limit pre-bake work to prepared texture sources #310
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!310
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-310"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tommiehansen on GitHub · 2026-12-03 12:20 UTC · original
tommiehansen:perf/phase3-bake-sources→main· +185 −28 · 2 files · 2 commits · merged 2026-12-03 16:56 UTCProblem
The decoration-bake path can process thousands of unrelated texture slots before drawing. The first implementation could treat a limited candidate list as complete and could attempt source preparation twice on fallback.
Implementation and correctness
Separate discovery from preparation. Accept the scoped pass only for a recognized bake pixel program and its documented table-1 constant/304-byte record layout. Reject unsupported bindings, unbounded record ranges, failed reads, truncated inputs and candidate overflow. A complete, nonempty candidate set must then prepare successfully before the broad pass can be omitted. On discovery failure the broad pass runs first, followed by one best-effort preparation. If already attempted, preparation is not repeated. The existing per-source recording and #248 GPU-written texture coverage remain in place. The code still scans the words of the bounded inputs; per-shader field offsets are not inferred without captures.
The opt-in path logs preparation time, skipped and fallback passes, candidate count and a labeled prior queue census. It does not count that census as proven avoided uploads. Unset
VICTORY_BAKE_SOURCES_ONLYto retain the broad path.Source and comparison
Inspired by foxhound #525.
The Foxhound test used an RTX 4070 SUPER (3440×1440, DLSS Performance, frame generation off) in two different play sessions. One bake needed 13 source slots, but the general pass uploaded about 8,100 of 10,458 due slots. The reported long frames in seconds containing bakes were 305–438 ms before the change. These figures motivate the xmem optimization; they do not establish its skip rate or FPS improvement.
Quick A/B test
VICTORY_BAKE_SOURCES_ONLYVICTORY_BAKE_SOURCES_ONLY=1Compare broad-pass frequency and time, successful skip/fallback counts, bake preparation time, frames over 100 ms and matched screenshots. A low skip rate indicates that layout recognition or source eligibility needs more work; it is not evidence that the underlying bottleneck is absent.
Validation and testing
Two targeted portable tests passed for failed/truncated reads, candidate overflow and fallback eligibility. Diagnostics Windows-target type checking also passed. Hardware benchmarking was unavailable. Please test matched decoration and character bakes and the same RT-enabled route on RX 9060 XT 16 GB at native 1080p and RX 9070 XT at native 1440p. Confirm the recognized layout and baked image parity before relying on the switch. No dependency on #313.
github-bot referenced this pull request2026-12-03 12:49:53 +00:00
github-bot referenced this pull request2026-12-03 16:15:25 +00:00