Diligent Engine
Loading...
Searching...
No Matches
Diligent::RadientTextureLoadInfo Struct Reference

Texture load attributes. Selects encoded bytes, supplied mip levels, or a URI source. More...

#include <RadientAssets.h>

Public Attributes

const Char * URI = nullptr
const Char * BaseURI = nullptr
IRadientDataBlob * pDataBlob = nullptr
const RadientTextureData * pTextureData = nullptr
Bool EncodedTextureIsSRGB = False

Detailed Description

Texture load attributes. Selects encoded bytes, supplied mip levels, or a URI source.

Member Data Documentation

◆ BaseURI

const Char* Diligent::RadientTextureLoadInfo::BaseURI = nullptr

Optional URI of the asset that references URI. Relative URI sources are resolved against this value by the active asset resolver.

◆ EncodedTextureIsSRGB

Bool Diligent::RadientTextureLoadInfo::EncodedTextureIsSRGB = False

Interpret encoded textures loaded from URI or pDataBlob as sRGB. Ignored when pTextureData is provided: RadientTextureData::Format determines the loaded format and the color space used for mip generation. Defaults to False.

◆ pDataBlob

IRadientDataBlob* Diligent::RadientTextureLoadInfo::pDataBlob = nullptr

Optional blob containing the complete encoded texture, starting at byte zero. Encoded BC textures require mip 0 width and height to be multiples of four; otherwise loading fails with RADIENT_STATUS_UNSUPPORTED. Smaller mip levels may have dimensions below four. Accepts read-only or mutable blobs. The blob must be non-empty and its size must fit in size_t. Mutually exclusive with pTextureData. Radient retains the blob and acquires read access during LoadTexture(), before returning. The data pointer and size are checked within this read scope. The encoded bytes are consumed directly; LoadTexture() does not copy them. Read access remains active until Radient no longer needs the source bytes, including any decoder references used during upload preparation. The caller may release its blob reference after LoadTexture() returns. For REFERENCE storage, the caller keeps the referenced bytes alive and unchanged throughout the blob's lifetime; OnDestroy can release their owner. Other readers may access the blob while Radient is reading it. Mutable blobs cannot be written or resized until all readers finish. Finish any write access before calling LoadTexture(); an active writer causes the call to return RADIENT_STATUS_INVALID_OPERATION without creating a texture asset. If acquiring read access fails, no matching EndRead() or last-reader callback is performed. Once acquired, access is released on completion or failure. OnLastReaderReleased, if set, may run before LoadTexture() returns or later on a worker thread. This notification reports that all readers have finished; it does not indicate GPU upload completion or end the lifetime requirement for REFERENCE storage. See RadientDataBlobCreateInfo for callback details.

◆ pTextureData

const RadientTextureData* Diligent::RadientTextureLoadInfo::pTextureData = nullptr

Optional pointer to supplied mip levels, mutually exclusive with pDataBlob. Only 2D texture data is currently supported. Radient preserves all supplied levels and generates the missing tail for uncompressed formats when RadientTextureData::GenerateMips is True. Compressed levels are loaded as supplied. The descriptor and mip array are copied during LoadTexture, and all referenced blobs are retained with read access while their bytes are needed; see RadientTextureMipData::pDataBlob.

◆ URI

const Char* Diligent::RadientTextureLoadInfo::URI = nullptr

Source URI. For memory-backed textures, this is optional and may be used as the texture identity for asset cache lookup and debugging.