Proposal: make host textures only for the mip levels the title has mapped (levels on demand), after measuring it #458
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Hayyan612 on 2026-11-27T21:00:49Z.
Mip-streamed textures are placed in a reservation and their levels mapped as they stream in, tail first and level 0 last (
texture_tests::streamed_mips_across_scattered_pool_pages_upload_each_step_without_whole_rereads). Uploads already follow that step by step. But the host texture seems to be made with the whole chain from the start, so a level the title has not mapped yet still takes host memory. Level 0 alone is about 73% of a texture's.ScarlettPort (ZigZagBoi1/ScarlettPort#64) makes host textures level by level as the title fills them. On an RX 9060 XT: median frame 18.9 → 22.0 fps, 90th percentile 92–160 ms → 75 ms, texture passes that found no room 2,839 → 48, with 19,900 host copies alive in 4.8 GB where 12,000 had taken 5.2 GB. They note that system RAM did not drop there, because staging grew. On Apple's unified memory the host copies are system memory, so the saving should count in full.
Measure first. A diagnostic, off by default (
VICTORY_TRACE_UNMAPPED_LEVELS=1): every N submissions, log the host bytes of texture levels whose title pages are all unmapped, total and per format. If testers' world runs show that it is large, then:Then. Make a mip-streamed texture's host copy with only its mapped levels, through the same
host_mip_rangemapping the top-mip drop (#347/#348) uses for views, and remake it with the next level when the title maps one. Metal sparse textures (heap-backed tiles following the title's page mappings) would be the other way, without the remake; Apple GPUs support them.Not claiming the change. I can write the diagnostic, with a test on the streamed-mips fixture, if it is wanted.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-27T22:07:51Z.
/claim
Taking the measure-first step only: VICTORY_TRACE_UNMAPPED_LEVELS=1 logging, every N submissions, the host bytes of texture levels whose title pages are all unmapped (total and per format). No behaviour change; the levels-on-demand remake stays for after the measurement.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T22:08:02Z.
Claimed by @AnastasisKon. Open a draft pull request with
Refs #458in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T21:07:27Z.
/release
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by AnastasisKon on 2026-11-28T21:07:28Z.
Releasing the claim: the remaining step on #458 is the measurement itself — world runs with VICTORY_TRACE_UNMAPPED_LEVELS=1 to see whether the unmapped-level host bytes are large enough to justify the levels-on-demand remake. The full game data (~137 GB at /Volumes/Anastasis' SSD/GTA6.Xbox.v1.0.2.1-CYBERLEEK) is still downloading on this machine, so no in-game numbers can be produced here yet; the diagnostic itself has landed (PR #496) and is ready for anyone with a complete install to run. The unit-test issues stay claimed — none of them need a game run.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-28T21:07:36Z.
Released. This issue is free to claim.