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[]): number
import { takeBatch } from '@driftengine/texture';

Parameters

ParameterTypeDescription
queuePrefetchQueue
isResident(hash: string) => boolean
bytesBudgetnumber
tileBytesnumber
outstring[]

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.