VRAM: upload staging rings stay at their peak size (~1.5 GB host-visible) #160

Closed
opened 2026-09-29 05:49:02 +00:00 by sky_line · 0 comments
Owner

The same capture shows 1,476 MB of upload staging in the VKMem breakdown (staging 1476, most of host-visible heap1's 1,790 MB).

This is a regression from b1d58c199b (stall-free buffer growth). Staging rings are now sized on demand (ensureStage, grow-only 1.5x) to the largest single upload. A full geometry re-stream (after a repack, or a fresh buffer) uploads the whole VBO/IBO in one streamBuf, so those rings grow to hundreds of MB each (x2 frame slots) and never shrink.

Fix

  • Chunk large uploads: full streams go through a bounded ring (e.g. 32-64 MB per frame slot), in several copies within the frame (or across frames for buffers not needed yet), instead of one staging buffer the size of the destination.
  • And/or shrink rings back after N frames below e.g. 1/4 of their size (retire + reallocate).
  • Cap and report staging separately in the VKMem line.

Target: staging back to tens of MB in steady state, with no return of the grow hitch. Watch the buffer grow: VKMem lines and HITCH lines when testing, including dipping underwater and surfacing.

Refs #157.

The same capture shows **1,476 MB of upload staging** in the VKMem breakdown (`staging 1476`, most of host-visible heap1's 1,790 MB). This is a regression from `b1d58c199b` (stall-free buffer growth). Staging rings are now sized on demand (`ensureStage`, grow-only 1.5x) to the largest single upload. A full geometry re-stream (after a repack, or a fresh buffer) uploads the whole VBO/IBO in one `streamBuf`, so those rings grow to hundreds of MB each (x2 frame slots) and **never shrink**. ## Fix - **Chunk large uploads**: full streams go through a bounded ring (e.g. 32-64 MB per frame slot), in several copies within the frame (or across frames for buffers not needed yet), instead of one staging buffer the size of the destination. - And/or **shrink rings back** after N frames below e.g. 1/4 of their size (retire + reallocate). - Cap and report staging separately in the VKMem line. Target: staging back to tens of MB in steady state, with no return of the grow hitch. Watch the `buffer grow:` VKMem lines and HITCH lines when testing, including dipping underwater and surfacing. Refs #157.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream#160
No description provided.