Table of Contents

Interface ITileCodec

Disk-format reader for one cache blob format: recognizes its tag and, for GPU-ready payloads, extracts the mip levels an upload needs.

public interface ITileCodec

Remarks

This is a disk format, not a GPU upload. Uploading the extracted bytes to a texture array layer stays in the runtime tile streamer. Wire formats (PNG/JPEG) set RequiresDecode and never use TryBuildMips(byte[], int, int, int, int, byte[][]).

Properties

Format

The TileCacheBlob.Format tag this codec recognizes.

TileCacheBlob.Format Format { get; }

Property Value

TileCacheBlob.Format

RequiresDecode

True when the payload is still compressed (PNG/JPEG) and needs an image decode; false when it is already GPU-ready blocks.

bool RequiresDecode { get; }

Property Value

bool

Methods

TryBuildMips(byte[], int, int, int, int, byte[][])

Extracts requiredLevels mip levels from a GPU-ready disk payload into caller-owned buffers.

bool TryBuildMips(byte[] payload, int offset, int length, int tileSizePx, int requiredLevels, byte[][] mips)

Parameters

payload byte[]

Disk payload bytes, not copied.

offset int

Start of this tile's payload in payload, in bytes.

length int

Readable byte count from offset.

tileSizePx int

Expected base-level edge length in texels.

requiredLevels int

Mip levels to copy, 1 or more.

mips byte[][]

Caller-owned buffers, one per level; each entry must already hold that level's block-byte count.

Returns

bool

True when the payload parsed and the levels were copied; false (never throws) on a corrupt or foreign-written entry.

Remarks

Only meaningful when RequiresDecode is false. The buffers in mips are reused across calls: size them before calling, do not allocate here.