DriftTexture · function
setDecodeMode
Change where the decode happens, invalidating every page that was decoded under the old rule.
Explained in DriftTexture.
function setDecodeMode(cache: PageCache, mode: DecodeMode): voidimport { setDecodeMode } from '@driftengine/texture';Parameters
| Parameter | Type | Description |
|---|---|---|
cache | PageCache | |
mode | DecodeMode |
In depth
Invalidating rather than converting. A page decoded per-sample and one decoded on residency hold different bytes, so keeping them and changing the flag serves a sampler the wrong ones — silently, and only for the pages that happened to be resident when somebody flipped the switch. The pages stay held; what is lost is the claim that their contents are current.