d3d12: the title texture pass can time-box its mapped and stale visits (RT-TITLE-EVERY-BUDGET) #2122
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2122
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2122/head"
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?
@OreoFR on GitHub · 2026-11-25 21:34 UTC · original
OreoFR:rt-title-every-budget→main· +123 −8 · 4 files · 2 commits · merged 2026-11-26 00:13 UTCClaimed in the coordination issue as: RT-TITLE-EVERY-BUDGET (#1608)
Depends on: nothing. Conflicts textually with #2050 and #2098, which change the same loop in
refresh_title_textures; whichever lands second rebases.What and why
Each pass of
refresh_title_texturesvisits every texture that is mapped by the title or known stale. During a streaming burst on retail that is thousands of textures, 30-75 ms a pass, before every submission on the title's submitting thread.LEONIDA_TITLE_EVERY_BUDGET_US(default0: unchanged) limits how long one pass spends on those visits:title_every_cursor_), in address order, so every marked texture gets its turn however many there are. The texture that crosses the limit is finished; one not reached keeps its mark and waits for a later pass.The walk is
leonida::visit_marked_title_texturesinruntime/src/title_texture_refresh.h, next topoll_title_textures, so it is tested without a device.The asynchronous variant is left out on purpose: #2098 already adds
LEONIDA_TEXTURE_REFRESH_ASYNC.Tested
xg_xs_test(new cases: unlimited pass visits every marked texture once and in order; one visit a pass rotates and wraps; the cursor survives an erased entry; an urgent texture comes first and is not visited twice in the same pass; empty registry). Built with MSVC 2022 RelWithDebInfo,xg_xspasses,gta6rtbuilds.In game, RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11, earlier base (
main+ #1893 + #1849), same build and inputs, 7 min runs:LEONIDA_TITLE_FILL_ASYNC=1)LEONIDA_TITLE_EVERY_BUDGET_US=4000, with the earlier asynchronous pass andLEONIDA_REFRESH_MAPPED_TEXTURES=0That run also had the asynchronous pass on and mapped refresh off, so the submission gain is not the budget's alone.
@DadaCap ran an earlier version on an RTX 5080 (621.24), with the budget and the asynchronous pass together: the pass itself went from 20.3 to 6.3 ms and the textures visited from 2,237 to 24 a pass, with no change in submissions per second on that machine (limited elsewhere). The gain depends on the machine.
No in-game run of this exact branch (budget alone, synchronous) yet.
Not checked: video planes over a long run. The urgent rule is meant for them, but no run here compared a video before and after.
GPUs tested: NVIDIA GeForce RTX 4070 Laptop GPU, driver 621.40, Windows 11 Pro (in game); NVIDIA GeForce RTX 5080, driver 621.24, Windows 11 (in game, by @DadaCap)
AI-assisted: yes (Claude Code, Claude Opus 5.5 wrote the change, the tests and this text)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
@JordanWebDev on GitHub · 2026-11-25 23:41 UTC · original · approved these changes
@aslan2142 on GitHub · 2026-11-26 00:13 UTC · original
Merged, thanks! A good lever for the streaming bursts that stall the submitting thread.
main(8d832fd10): #2098 split this loop by mode. WithLEONIDA_TEXTURE_REFRESH_ASYNCevery persistent mapping is polled each pass on the refresh worker, asmainhas it. Your budget applies to the synchronous pass, the one before a submission on the submitting thread, and the README now says it does not apply under async.0keeps today's behaviour). The cursor gives every marked texture its turn, and a mapped texture never filled is visited first whatever the limit.xg_xspasses on both.d3d12_set_descriptor_heapsfails onmainalone too, andvk_presenter_sparse_capturefails under Wine onmainas well.mainc50ed94b3+8d832fd10: it merges cleanly; the semantic suite passes (495 files, 6,333 tests, 0 files failed); the 15 docs and writer tests pass;check_no_game_data.pyis clean on the 4 changed files.AI-assisted (Claude Code, Claude Opus 5.5).