Repository navigation
Conversation
The pool walk makes the smallest textures up front while currentAllocatedSize is under a twentieth of the working set. That counter counts each no-copy buffer in full, so in a game with many pools it is past the budget from the first load and nothing is made up front: those IDs read the dummy until a shader's read is noticed. With the switch set, the walk compares against the residency set instead. It is off by default. Checked: t_pool_chunks and t_cpu_tex. Ocarina of Time v131072 on an M6 Mac with 24 GB, same save and inputs, DM_POOL_BUDGET_MB=6000 against the default: IDs left out 3,274 to 698, 3,081 to 3,285 MB in the set, frame time p50 14.1 to 14.3 ms, no GPU errors. That run read the set's size at its last commit, on main 75c1a8c with other open PRs; this version reads it directly and has not been run in a game. Not tried on a smaller Mac or other games.
490fbfa to
66cde28
Compare
|
Rebased on main, where |
…eedds#1498) The pool walk makes the smallest textures up front while currentAllocatedSize is under a twentieth of the working set, and that counter counts each no-copy buffer in full, so in Ocarina of Time it is over budget from the first load and nothing is made up front. The switch compares against the residency set instead. Off by default. Measured on Ocarina of Time v131072: IDs left out 3,274 -> 698, frame time p50 14.1 -> 14.3 ms.
|
Thanks for investigating this and sharing the before/after measurements, @akshay4. We're closing this PR for now. We checked the measurements from your Ocarina of Time run: while pre-creating textures reduced the missing-ID count (3,274 down to 698), it increased memory use (3,081 to 3,285 MB) and slightly raised median frame time (14.1 to 14.3 ms) without a measured visual improvement, and the later rebase wasn't re-tested in-game. We'll keep your measurements here for reference, and we can revisit an opt-in option if a visible texture pop-in issue is reproduced and shown to improve. |
What and why
The pool walk makes the smallest textures up front while
currentAllocatedSizeis under a twentieth of the working set. That counter counts each no-copy buffer in full (50 over one 64 MB region add 3,200 MB, see #1482), so in Ocarina of Time it is over budget from the first load and nothing gets made up front. Those IDs read the dummy until a shader's read is noticed, which can show as textures filling in late.DM_POOL_BUDGET_MB=<MB>compares against the residency set instead. Off by default, so nothing changes without it.Entry added under the pool walk in
docs/reference/memory.md.Checked
check_t_pool_chunks,check_t_cpu_tex,test_docs.py,test_env_switches.py0400486024DEC000v131072, same save and inputs, about 2 minutes each:DM_POOL_BUDGET_MB=6000regress.pynot run: nothing changes unless the switch is set.Docs
docs/reference/memory.md,docs_symptoms.pyrun, row indocs/env_switches.tsv