![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <TextureMipAllocator.h>
Inheritance diagram for FTextureMipAllocator:Public Types | |
| enum class | ETickState : uint32 { AllocateMips , UploadMips , Done } |
| enum class | ETickThread : uint32 { Async , Render , None } |
Public Member Functions | |
| FTextureMipAllocator (UTexture *Texture, ETickState InTickState, ETickThread InTickThread) | |
| FTextureMipAllocator (const FTextureMipAllocator &) | |
| FTextureMipAllocator (FTextureMipAllocator &&) | |
| virtual | ~FTextureMipAllocator () |
| FORCEINLINE ETickState | GetNextTickState () const |
| FORCEINLINE ETickThread | GetNextTickThread () const |
| virtual bool | AllocateMips (const FTextureUpdateContext &Context, FTextureMipInfoArray &OutMipInfos, const FTextureUpdateSyncOptions &SyncOptions)=0 |
| virtual bool | UploadMips (const FTextureUpdateContext &Context, const FTextureUpdateSyncOptions &SyncOptions)=0 |
| bool | FinalizeMips (const FTextureUpdateContext &Context, const FTextureUpdateSyncOptions &SyncOptions) |
| void | ExecuteCancel (const FTextureUpdateSyncOptions &SyncOptions) |
| ETickThread | ExecuteGetCancelThread () const |
| const FTextureRHIRef & | GetIntermediateTextureRHI () const |
Protected Member Functions | |
| virtual void | Cancel (const FTextureUpdateSyncOptions &SyncOptions)=0 |
| virtual ETickThread | GetCancelThread () const =0 |
| FORCEINLINE void | AdvanceTo (ETickState InState, ETickThread InThread) |
Protected Attributes | |
| const FStreamableRenderResourceState | ResourceState |
| const int32 | CurrentFirstLODIdx = INDEX_NONE |
| const int32 | PendingFirstLODIdx = INDEX_NONE |
| FTextureRHIRef | IntermediateTextureRHI |
FTextureMipAllocator defines the update steps and interface to implement the mip allocation strategy used in FTextureStreamIn. It allows to decouples the texture creation steps from the texture update. Typical implementations are using RHIAsyncCreateTexture2D, RHIAsyncReallocateTexture2D or virtual textures.
|
strong |
|
strong |
| FTextureMipAllocator::FTextureMipAllocator | ( | UTexture * | Texture, |
| ETickState | InTickState, | ||
| ETickThread | InTickThread | ||
| ) |
|
default |
|
default |
|
virtualdefault |
|
inlineprotected |
|
pure virtual |
Allocate the FTextureMipInfoArray and configure the entries for the new (streamed in) mips. In particular, the FTextureMipAllocator must set valid FTextureMipInfo::DestData so that the mip data provider can write the mip data to.
| Context | - An update context constant throughout the FTextureStreamIn update. Gives things like which texture asset is updated and what mips are streamed in. |
| OutMipInfos | - The array of FTextureMipInfo that must be correctly configured so that FTextureMipDataProvider know what is being requested and where to write data to. |
| SyncOptions | - Different sync options to control when the next tick of FTextureStreamIn can be scheduled. |
Return true unless the texture update needs to be aborted because of invalid data or setup.
Implemented in FTexture2DArrayMipAllocator_Reallocate, FTexture2DMipAllocator_AsyncCreate, FTexture2DMipAllocator_AsyncReallocate, FTexture2DMipAllocator_Virtual, and FVolumeTextureMipAllocator_Reallocate.
|
protectedpure virtual |
Cancel the progression and release any temporary resources. Called within the FTextureStreamIn update when the stream in request is aborted or cannot complete correctly The Cancel() function is called on the thread returned by GetCancelThread().
| SyncOptions | - Different sync options to control when the next tick of FTextureStreamIn can be scheduled. |
Implemented in FTexture2DArrayMipAllocator_Reallocate, FTexture2DMipAllocator_AsyncCreate, FTexture2DMipAllocator_AsyncReallocate, FTexture2DMipAllocator_Virtual, and FVolumeTextureMipAllocator_Reallocate.
| void FTextureMipAllocator::ExecuteCancel | ( | const FTextureUpdateSyncOptions & | SyncOptions | ) |
| FTextureMipAllocator::ETickThread FTextureMipAllocator::ExecuteGetCancelThread | ( | ) | const |
| bool FTextureMipAllocator::FinalizeMips | ( | const FTextureUpdateContext & | Context, |
| const FTextureUpdateSyncOptions & | SyncOptions | ||
| ) |
Update the texture resource with the new RHI texture. Update is completed after this step and can not be canceled afterward..
| Context | - An update context constant throughout the FTextureStreamIn update. Gives things like which texture asset is updated and what mips are streamed in. |
| SyncOptions | - Different sync options to control when the next tick of FTextureStreamIn can be scheduled. |
Return true unless the texture update needs to be aborted because of invalid data or setup.
|
protectedpure virtual |
|
inline |
|
inline |
|
inline |
|
pure virtual |
Upload the new mip data to the GPU. The
| Context | - An update context constant throughout the FTextureStreamIn update. Gives things like which texture asset is updated and what mips are streamed in. |
| SyncOptions | - Different sync options to control when the next tick of FTextureStreamIn can be scheduled. |
Return true unless the texture update needs to be aborted because of invalid data or setup.
Implemented in FTexture2DArrayMipAllocator_Reallocate, FTexture2DMipAllocator_AsyncCreate, FTexture2DMipAllocator_AsyncReallocate, FTexture2DMipAllocator_Virtual, and FVolumeTextureMipAllocator_Reallocate.
|
protected |
|
protected |
The intermediate texture async created in the update process.
|
protected |
|
protected |
The streamable state requested.