Make an area's textures at once after a load instead of over the first seconds, which showed the ground and walls black.

The texture pool creates 16 entries a refresh and stops after 6 ms a frame, so that textures streaming in do not make
long frames. An area load leaves thousands of slots at once (4,936 loading the test save), and at that rate they came
in over the frames after the load screen: the scene's first frames showed a quarter of the picture as black stand-ins,
for 22 presented frames on a free machine and for about three seconds with the CPU busy.

While a refresh leaves pool_load_backlog slots or more (512; 0 never), the pool is loading: the count limit is off, a
frame's refreshes may take pool_load_ms (50), and frame_hold leaves out the presents of frames drawn meanwhile (up to
2 s), so the picture before the load stays until fewer than 64 slots are left. Measured with the flight recorder's
thumbnails of every present: the 4,847 textures are made in one frame of 345 ms, 30 frames before the scene fades in,
and the black share of the picture goes from the fade straight to its final value. The streaming limits are as before
below the backlog.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-10 06:55:13 -05:00
parent 91a8da9eb3
commit 71eb5fbe26
5 changed files with 67 additions and 11 deletions

View File

@@ -189,6 +189,9 @@ void vk_exec_frame_log(const tex_t *presented, uint64_t frame);
// a frame lacking them would be held back at its present (vk_backend.c frame_hold).
uint32_t vk_exec_pending_draws_take(void);
int vk_frame_hold_left(void);
// 1 while the texture pool makes the textures of an area load (vk_exec_draw.c pool_load_backlog): the frames drawn
// meanwhile show black stand-ins, and frame_hold leaves their presents out.
int vk_exec_pool_loading(void);
// NX2NAVI_DUMP=<frame> (vk_dump.c): between presents frame-1 and frame, every pass's targets and every dispatch's storage
// images are copied out and written as PNGs to NX2NAVI_DUMP_DIR (default "dump"), with passes.txt (targets, pipelines,