public interface IPageStoreWhat a residency service needs of whoever owns the memory.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The seam that keeps PageResidency from being geometry-shaped — improvement 6 of docs/plan/22-virtualized-geometry.md. Unreal runs Nanite streaming, virtual texture streaming and the shadow page pool as three systems with three budgets and three eviction policies; Vixen has none of them yet, which is an advantage exactly once. What is common to all three is a request queue, a byte budget and an eviction order, and what differs is where the bytes go and how they are read — so those two are here and nothing else is.
Loading is asynchronous because the asset system's I/O is, and because the alternative is a frame that blocks on a disk. Placing is synchronous because it is a copy into memory the pool already owns.
⚠ Two threading contracts, and they are not the same one. LoadAsync is called on thread-pool threads and several calls are in flight at once — Service's maxLoads is exactly how many — so an implementation of it has to be safe under concurrency with itself and with the frame. Place and Evict are called from Service, on the caller's own thread, and need no synchronisation at all. Writing the whole interface to the second contract is the mistake this paragraph exists to stop: a load that fills one buffer the store owns looks correct until two pages are wanted in the same frame, and then it hands one page another page's bytes — which surfaces as corrupt content rather than as a threading fault.
Fields and properties (2)
int PageSizeHow many bytes one page occupies in the pool.
int SlotCountHow many slots the pool has.
Methods (4)
ValueTask<int> LoadAsync(PageKey key, Memory<byte> destination, CancellationToken cancellation)Reads a page's bytes.
bool Place(PageKey key, int slot, ReadOnlySpan<byte> bytes)Puts a loaded page's bytes into a slot.
void Evict(PageKey key, int slot)Says a page is no longer resident, and its slot is about to be reused.
bool CanPlace(PageKey key, int bytes)Whether a placement would be taken, asked before anything is evicted for it.
Used by (9)
- FakeStoreVixen.Rendering.Tests
- FoliageCellPagesVixen.Rendering.Terrain
- InstantStoreVixen.Rendering.Tests
- MeshletPagePoolVixen.Rendering
- PageResidencyVixen.Rendering
- SharingStoreVixen.Rendering.Tests
- TerrainTilePagesVixen.Rendering.Terrain
- TexturePagePoolVixen.Engine.Renderer
- VirtualShadowPagesVixen.Rendering