Repository navigation
Conversation
|
First iOS numbers for this, and they pin down a limit we had only guessed at. iPad Pro 13" M4, Breath of the Wild 1.9.0,
The 115 MB render buffer pool is 2.2 MB from full. That matches a crash we had already found by bisecting render scale on this device: 1.40 plays, 1.45 dies with It also settles a review point on my #316: a render scale slider that reaches 2.0 can crash the game, and a per-profile Worth noting for anyone reading the numbers: the second pool is half empty with a 244 MB contiguous run free, so the pressure is specific to the render buffer pool rather than general. Ran against an older |
|
@Xipzer thanks! I'll check your comment later in detail |
9de1738 to
275b8c6
Compare
|
@Xipzer looks like this diagnostic flag actually helps to find issues like this. Thanks for checking! Is there an issue already for the TotK you mentioned? |
…size, a line each time textures are first placed on more of the pool's 64 KB pages, with the largest range never used: how full a game's render target pool gets, also when it allocates from both ends. Breath of the Wild's 115 MB render buffer pool with the inventory, map and System menu opened: 78.8 MB used at a 1920x1080 output, 107.1 MB at 2346x1320 The page set is in nvn_poolpeak.h (pure C), which hle_nvn.c's nvnTextureInitialize fills; t_poolpeak.c checks it (pages marked once, a texture across a page boundary, both ends of the pool, a range split in the middle, nothing past the pool's end, a pool of 1.5 pages). docs/agents/04-graphics.md lists the switch.
|
No TotK issue yet, and I don't think I mentioned one here, so I may be missing which report you mean. If it's the render pool question: I haven't run |
The ceiling is what the platform can reserve, not which platform it is. iOS caps one reservation at 6 GB (hle_svc.c), and the pool's growth comes on top of the game's mem_reserve, so render_pool_max takes the highest factor whose RESERVE fits. Breath of the Wild reserves 4 GB: every factor to 3.0 fits (5.92 GB at 3.0). Measured on an iPad Pro 13" M4: 1.40 plays with the pool doubled (180 MB more), where it crashed at 1.45 without the growth (seedds#303).
The clamp in the loader was 0.5 to 1.0 for every game, so a build whose rewriter table has RENDER_SCALE could never render above the size the game picks itself, even where it holds. Above its own resolution a game renders into render target pools it sized for that resolution, which the host cannot size from outside, so a scene eventually needs more than a pool holds and the game takes a null allocation back. How far that goes is per game and only measurement finds it, so the limit belongs in the profile rather than in the host. render_scale_max, 1.0 by default, is the highest DM_RENDER_SCALE the game survives. The loader refuses anything above it and names the key in the message, and the iOS launcher's slider stops there, because a slider that can crash a game is not a setting. A range in settings.tsv may now take a bound from a DM_GAME_<NAME> macro, which is how the slider learns the ceiling. Breath of the Wild 1.9.0 is 1.35, measured rather than guessed. gsys sub-allocates every render target from one 115 MB render buffer pool it sizes at start. With seedds#303's DM_NVN_POOLPEAK on an iPad Pro 13" M4, docked, open world with the inventory and map opened: render scale 1.40 112.8 MB of 115.0 MB used (98.1%), plays render scale 1.45 SIGSEGV at main+0xed7128 address 0x20 while the field loads: gsys::RenderBufferContext takes a null back 1.40 is 2.2 MB from full, so the ceiling is the step below it. No behaviour changes for any game that does not set the key: the default of 1.0 gives the clamp and the slider exactly the range they had.
Update (2026-10-27): rebased on
main75065df (only the gfx tests' run list and.gitignoreconflicted).t_poolpeak(13 checks), the env and docs tests and the BotW host build pass. Thanks @Xipzer for the iPad numbers above.A diagnostic for how much of a large memory pool textures take
Some games sub-allocate every render target from one large memory pool and crash when it runs out. Breath of the Wild does this with gsys's 115 MB render buffer pool: at a 2560x1440 output (with the MetalFX scene upscale, not yet a PR) its inventory crashed in
RenderBufferContext. The host had no way to see how close a scene came to that limit. The highest offset in use says little, because the game allocates from both ends of the pool.DM_NVN_POOLPEAK=<MB>watches every memory pool of at least that size. InnvnTextureInitialize, it records which 64 KB pages of the pool textures have ever been placed on. Each time that set grows, it logs one line:It's off by default and costs nothing unless it's set.
dm/gfx/nvn/nvn_poolpeak.h, a pure-C header with no host state: mark a range, count new pages, find the largest unused run.hle_nvn.ccalls the header for up to 8 pools.docs/agents/04-graphics.mdlists the switch with the otherDM_NVN_*diagnostics.Measured (Breath of the Wild 1.9.0, M2 Max, inventory, map and System menu opened)
Checked
t_poolpeak(new, in the gfx run list, 13 checks):ci.sh(host tests, CPU gfx tests, every gfx test built,dmhostfor three profiles, the iOS compile check, the tool tests): no failures.dmhostfor Breath of the Wild, its iOS compile check, andt_nvn(154 checks).