DriftTexture · function
takeBatch
Take the next batch, soonest first, within a byte budget.
Explained in DriftTexture.
function takeBatch(queue: PrefetchQueue, isResident: (hash: string) => boolean, bytesBudget: number, tileBytes: number, out: string[]): numberimport { takeBatch } from '@driftengine/texture';Parameters
| Parameter | Type | Description |
|---|---|---|
queue | PrefetchQueue | |
isResident | (hash: string) => boolean | |
bytesBudget | number | |
tileBytes | number | |
out | string[] |
In depth
Residency is checked here rather than at enqueue, because it may have changed in between — a tile requested eight frames ahead may well have arrived by the time its turn comes.