Logo Mibo

PaletteChunkCache Type

Per-frame cache of staged bone-palette texture chunks for skinned + instanced draws, SHARED by the shadow pass and the forward PBR pass: both passes stage the same palettes every frame, so doing it in each pass doubled the most expensive per-frame work (count * boneCount matrices at 64B each, staged + uploaded). The first pass to request a (palettes, boneCount, count) triple stages + uploads it; the second gets the same chunk textures back.

Memo validity is per frame: the palettes arrays are game-owned and stable for the duration of the frame's render flush (both passes draw from the same command buffer before the game mutates them again), and ReleaseAll — called once per frame alongside the pool's — drops every memo. Keyed by array reference + (boneCount, count).

Constructors

Constructor Description

PaletteChunkCache()

Full Usage: PaletteChunkCache()

Returns: PaletteChunkCache

Instance members

Instance member Description

this.Obtain

Full Usage: this.Obtain

Parameters:
Returns: (int * int * Texture2D)[]

Returns the palette-texture chunks covering count instances (≤ PaletteTexture.MaxHeight instances per chunk) as (chunkStart, chunkCount, texture) triples, staging + uploading them on first request this frame.

gd : GraphicsDevice
palettes : Matrix[]
boneCount : int
count : int
Returns: (int * int * Texture2D)[]

this.ReleaseAll

Full Usage: this.ReleaseAll

Returns last frame's chunk textures to the pool and drops every memo (per-frame lifetime — see PaletteTexturePool).

Type something to start searching.