class

FTextureStreamer

Texture mip-streaming (slice 1). A streamable texture is a cooked .mtex whose per-mip table lets us read ANY mip range without touching the rest of the file. Registration makes only the coarse TAIL resident; StreamTo(mip) re-reads mips [mip..N) and swaps in a new image (Vulkan commits an image's full memory at creation, so residency changes are recreate-and-swap — the UE non-virtual streaming model). Synchronous v1; async via StreamingIOQueue and GPU-copy reuse of already-resident levels are follow-ups. Consumers must re-query GetImage() after a stream (the Ref changes) — cached descriptor sets keep the OLD image alive until rebound.

Module
Game
Header
#include "Streaming/TextureStreamer.h"
Namespace
Mowo

Properties

TypeNameDescription
static constexpr uint32_tkInvalidHandleDefault 0xFFFFFFFFu.

Public functions

ReturnsNameDescription
uint32_tRegisterReads the header + mip table (not the pixels).
uint32_tRegisterFromSourceRegister an ordinary image source (PNG/JPG/BMP/...): cooks it into a .mtex mip chain in the DDC (EnsureCookedMtex — requires ddc.TextureCook on + an initialized DDC) and streams from the cache entry.
voidUnregister
boolStreamToMake mips [topMip..chain end) resident.
boolStreamToAsyncAsync variant: one range-read on the StreamingIOQueue, upload+swap deferred to ApplyCompleted() (GPU uploads and the Ref swap must happen on the main thread).
uint32_tApplyCompletedDrain finished async reads and finished GPU assemblies, on the CALLER's thread (main).
boolHasPendingStream
Ref<Image2D>GetImage
uint32_tGetResidentTopMip
uint32_tGetMipCount
uint64_tGetResidentBytes
uint64_tGetTotalResidentBytes
uint32_tGetTopWidthSource mip 0 width — the full-resolution extent mip selection is computed against.
boolGetAverageColorThe cook-baked linear-space average color from a v2 .mtex header.
uint64_tGetChainBytesBytes the chain [topMip..N) would occupy if resident — the budget math FTextureStreamingManager coarsens against.

Function details

Register

C++
uint32_t Register(const std::string& mtexPath, uint32_t tailMips = 3)

Reads the header + mip table (not the pixels). tailMips = how many coarsest levels to make resident immediately (clamped to the chain).

RegisterFromSource

C++
uint32_t RegisterFromSource(const std::string& sourcePath, uint32_t tailMips = 3)

Register an ordinary image source (PNG/JPG/BMP/...): cooks it into a .mtex mip chain in the DDC (EnsureCookedMtex — requires ddc.TextureCook on + an initialized DDC) and streams from the cache entry. .mtex paths pass straight through to Register.

Unregister

C++
void Unregister(uint32_t handle)

StreamTo

C++
bool StreamTo(uint32_t handle, uint32_t topMip)

Make mips [topMip..chain end) resident. topMip 0 = full resolution. Returns false when the handle/mip is invalid or IO fails (previous residency is kept).

StreamToAsync

C++
bool StreamToAsync(uint32_t handle, uint32_t topMip, IOPriority priority = IOPriority::High)

Async variant: one range-read on the StreamingIOQueue, upload+swap deferred to ApplyCompleted() (GPU uploads and the Ref swap must happen on the main thread). A newer request for the same handle supersedes a pending one (the stale read's apply is dropped).

ApplyCompleted

C++
uint32_t ApplyCompleted()

Drain finished async reads and finished GPU assemblies, on the CALLER's thread (main). Uploads are submitted fire-and-forget through the RHI's async image assembly and byte-budgeted per frame (r.TextureStreaming.MaxUploadBytesPerFrame); the visible Ref swap happens only when the GPU work's fence has signalled. Returns how many textures changed residency this call.

HasPendingStream

C++
bool HasPendingStream(uint32_t handle) const

GetImage

C++
Ref<Image2D> GetImage(uint32_t handle) const

GetResidentTopMip

C++
uint32_t GetResidentTopMip(uint32_t handle) const

GetMipCount

C++
uint32_t GetMipCount(uint32_t handle) const

GetResidentBytes

C++
uint64_t GetResidentBytes(uint32_t handle) const

GetTotalResidentBytes

C++
uint64_t GetTotalResidentBytes() const

GetTopWidth

C++
uint32_t GetTopWidth(uint32_t handle) const

Source mip 0 width — the full-resolution extent mip selection is computed against.

GetAverageColor

C++
bool GetAverageColor(uint32_t handle, float outRgba[4]) const

The cook-baked linear-space average color from a v2 .mtex header. False for v1 files (no average was baked).

GetChainBytes

C++
uint64_t GetChainBytes(uint32_t handle, uint32_t topMip) const

Bytes the chain [topMip..N) would occupy if resident — the budget math FTextureStreamingManager coarsens against.

Generated from Streaming/TextureStreamer.h via game.json · Nov 5, 2026Version 1.0.0