class

TextureAsset

TextureAsset: UUID-identified, two-phase loaded texture. Load() lifts a block-compressed .mtex chain for GPU-native upload when the source (or its cooked sidecar) carries one, and otherwise decodes the image from VFS to RGBA8 (CPU, thread-safe). CreateGPU() uploads the BC mips as-is through Image2D::CreateWithMips — no CPU decompress, the cooked compression reaches the device — or the decoded RGBA through Texture2D::Create on the fallback path.

Module
AssetSystem
Header
#include "AssetSystem/Assets/TextureAsset.h"
Namespace
Mowo

Constructors

SignatureNameDescription
TextureAsset()TextureAsset
~TextureAsset() override~TextureAsset

Public functions

ReturnsNameDescription
boolLoadAsset interface
voidUnload
boolCreateGPU
voidDestroyGPU
boolDestroyGPUIsFrameSafe
boolCanAdoptLoadedState
voidAdoptLoadedState
Ref<Texture2D>GetGPUTextureGet Platform/ texture (available after CreateGPU)
Ref<Image2D>GetGPUImage
const DecodedImage&GetDecodedImageDecoded RGBA8 pixels: filled by Load and, unless the CPU copy is kept, emptied once CreateGPU has uploaded them — the device copy is the one every sampler reads, and a 4K source held a 64 MB duplicate for the asset's lifetime.
voidSetKeepCpuCopyOpt-in for a tool that reads the pixels after upload (a CPU sampler, a heightfield, an editor paint tool): call before CreateGPU.
boolHasCpuCopy
boolIsArrayA Texture2DArray asset: an array .mtex (FTextureArrayBuilder writes one from a list of images).
uint32_tGetLayerCount
uint32_tGetWidth
uint32_tGetHeight
uint64_tEstimatedMemoryUsageNative BC: the exact cooked chain size.
TextureImportSettings&GetImportSettingsImport settings
const TextureImportSettings&GetImportSettings
boolHasAuthoredImportSettingsTrue once a sidecar has spoken for this texture.
voidWriteImportSettingsMetadata
voidReadImportSettings

Function details

TextureAsset

C++
TextureAsset()

~TextureAsset

C++
~TextureAsset() override

Load

C++
bool Load(const std::string& path) override

Asset interface

Unload

C++
void Unload() override

CreateGPU

C++
bool CreateGPU(const GPUContext& ctx) override

DestroyGPU

C++
void DestroyGPU() override

DestroyGPUIsFrameSafe

C++
bool DestroyGPUIsFrameSafe() const override

CanAdoptLoadedState

C++
bool CanAdoptLoadedState() const override

AdoptLoadedState

C++
void AdoptLoadedState(Asset& loaded) override

GetGPUTexture

C++
Ref<Texture2D> GetGPUTexture() const

Get Platform/ texture (available after CreateGPU)

GetGPUImage

C++
Ref<Image2D> GetGPUImage() const

GetDecodedImage

C++
const DecodedImage& GetDecodedImage() const

Decoded RGBA8 pixels: filled by Load and, unless the CPU copy is kept, emptied once CreateGPU has uploaded them — the device copy is the one every sampler reads, and a 4K source held a 64 MB duplicate for the asset's lifetime. A CreateGPU after DestroyGPU re-reads the source.

SetKeepCpuCopy

C++
void SetKeepCpuCopy(bool keep)

Opt-in for a tool that reads the pixels after upload (a CPU sampler, a heightfield, an editor paint tool): call before CreateGPU. r.Texture. KeepCpuCopy=1 keeps every texture's copy.

HasCpuCopy

C++
bool HasCpuCopy() const

IsArray

C++
bool IsArray() const

A Texture2DArray asset: an array .mtex (FTextureArrayBuilder writes one from a list of images). Material graphs sample it with TextureSampleArray; every other consumer sees layer 0.

GetLayerCount

C++
uint32_t GetLayerCount() const

GetWidth

C++
uint32_t GetWidth() const

GetHeight

C++
uint32_t GetHeight() const

EstimatedMemoryUsage

C++
uint64_t EstimatedMemoryUsage() const override

Native BC: the exact cooked chain size. RGBA8: pixels + full mip chain (×4/3). Once the CPU copy is gone, what the upload measured.

GetImportSettings

C++
TextureImportSettings& GetImportSettings()

Import settings

GetImportSettings

C++
const TextureImportSettings& GetImportSettings() const

HasAuthoredImportSettings

C++
bool HasAuthoredImportSettings() const

True once a sidecar has spoken for this texture. Load() derives sRGB and the texture group from the filename ONLY while this is false, so an artist who set sRGB by hand keeps it through every later rescan.

WriteImportSettings

C++
void WriteImportSettings(MdfNode& importNode) const override

Metadata

ReadImportSettings

C++
void ReadImportSettings(const MdfNode& importNode) override
Generated from AssetSystem/Assets/TextureAsset.h via assetsystem.json · Nov 4, 2026Version 1.0.0