UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FTexture2DMipDataProvider_IO Class Reference

#include <Texture2DMipDataProvider_IO.h>

+ Inheritance diagram for FTexture2DMipDataProvider_IO:

Classes

struct  FIORequest
 

Public Member Functions

 FTexture2DMipDataProvider_IO (const UTexture *InTexture, bool InPrioritizedIORequest)
 
 ~FTexture2DMipDataProvider_IO ()
 
void Init (const FTextureUpdateContext &Context, const FTextureUpdateSyncOptions &SyncOptions) final override
 
int32 GetMips (const FTextureUpdateContext &Context, int32 StartingMipIndex, const FTextureMipInfoArray &MipInfos, const FTextureUpdateSyncOptions &SyncOptions) final override
 
bool PollMips (const FTextureUpdateSyncOptions &SyncOptions) final override
 
void AbortPollMips () final override
 
void CleanUp (const FTextureUpdateSyncOptions &SyncOptions) final override
 
void Cancel (const FTextureUpdateSyncOptions &SyncOptions) final override
 
ETickThread GetCancelThread () const final override
 
- Public Member Functions inherited from FTextureMipDataProvider
ENGINE_API FTextureMipDataProvider (const UTexture *Texture, ETickState InTickState, ETickThread InTickThread)
 
virtual ~FTextureMipDataProvider ()
 
ETickState GetNextTickState () const
 
ETickThread GetNextTickThread () const
 
virtual bool PostprocessGPUMipData (const FTextureUpdateContext &Context, const FTextureRHIRef &NewTextureRHI, const FTextureUpdateSyncOptions &SyncOptions)
 
virtual ENGINE_API bool PostprocessGPUMipData (const FTextureUpdateContext &Context, const FTextureRHIRef &TextureRHI, int32 FirstMip, int32 NumMips, const FTextureUpdateSyncOptions &SyncOptions)
 
virtual void AbortPostprocessGPUMipData ()
 

Protected Member Functions

void SetAsyncFileCallback (const FTextureUpdateSyncOptions &SyncOptions)
 
void ClearIORequests ()
 
- Protected Member Functions inherited from FTextureMipDataProvider
void AdvanceTo (ETickState InState, ETickThread InThread)
 

Protected Attributes

TArray< FIORequest, TInlineAllocator< MAX_TEXTURE_MIP_COUNT > > IORequests
 
FName TextureName
 
bool bPrioritizedIORequest = false
 
bool bIORequestCancelled = false
 
bool bIORequestAborted = false
 
FBulkDataIORequestCallBack AsyncFileCallBack
 
- Protected Attributes inherited from FTextureMipDataProvider
const FStreamableRenderResourceState ResourceState
 
const int32 CurrentFirstLODIdx = INDEX_NONE
 
const int32 PendingFirstLODIdx = INDEX_NONE
 

Additional Inherited Members

- Public Types inherited from FTextureMipDataProvider
enum class  ETickState : uint32 {
  Init , GetMips , PollMips , PostprocessGPUMipData ,
  CleanUp , Done
}
 
enum class  ETickThread : uint32 { Async , Render , None }
 

Detailed Description

FTexture2DMipDataProvider_IO implements FTextureMipAllocator using file IO (cooked content). It support having mips stored in different files contrary to FTexture2DStreamIn_IO.

Constructor & Destructor Documentation

◆ FTexture2DMipDataProvider_IO()

FTexture2DMipDataProvider_IO::FTexture2DMipDataProvider_IO ( const UTexture InTexture,
bool  InPrioritizedIORequest 
)

◆ ~FTexture2DMipDataProvider_IO()

FTexture2DMipDataProvider_IO::~FTexture2DMipDataProvider_IO ( )

Member Function Documentation

◆ AbortPollMips()

void FTexture2DMipDataProvider_IO::AbortPollMips ( )
finaloverridevirtual

Abort anything that could be stalling the update in PollMips(). Called from an async task. Expected behavior is to cancel any pending IO operations. Called when the FTextureStreamIn update is canceled and the current step is to be waiting on upon PollMips(). This is because Cancel() can only be executed when any pending operations are completed (see FTextureUpdateSyncOptions). Will be used if executing PollMips

Reimplemented from FTextureMipDataProvider.

◆ Cancel()

void FTexture2DMipDataProvider_IO::Cancel ( const FTextureUpdateSyncOptions SyncOptions)
finaloverridevirtual

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().

Parameters
SyncOptions- Different sync options to control when the next tick of FTextureStreamIn can be scheduled.

Implements FTextureMipDataProvider.

◆ CleanUp()

void FTexture2DMipDataProvider_IO::CleanUp ( const FTextureUpdateSyncOptions SyncOptions)
finaloverridevirtual

Release any temporary data and objects that where used for the update. Final step executed after the texture has been updated correctly.

Parameters
SyncOptions- Different sync options to control when the next tick of FTextureStreamIn can be scheduled.

Implements FTextureMipDataProvider.

◆ ClearIORequests()

void FTexture2DMipDataProvider_IO::ClearIORequests ( )
protected

◆ GetCancelThread()

FTextureMipDataProvider::ETickThread FTexture2DMipDataProvider_IO::GetCancelThread ( ) const
finaloverridevirtual

◆ GetMips()

int32 FTexture2DMipDataProvider_IO::GetMips ( const FTextureUpdateContext Context,
int32  StartingMipIndex,
const FTextureMipInfoArray MipInfos,
const FTextureUpdateSyncOptions SyncOptions 
)
finaloverridevirtual

Acquire the mips this provider will handle. Non handled mips must be handled by the next mip data provider or the update will be cancelled altogether. GetMips() must typically advance to PollMips() if it wants to be able to notify FTextureStreamIn that something went wrong and that the update must be cancelled.

Parameters
Context- An update context constant throughout the FTextureStreamIn update. Gives things like which texture asset is updated and what mips are streamed in.
StartingMipIndex- The current starting mip index, somewhere between FTextureUpdateContext::PendingFirstMipIndex and FTextureUpdateContext::CurrentFirstMipIndex inclusively.
MipInfos- The array of FTextureMipInfo that hold the information relative to each mip for which data must be provided.
SyncOptions- Different sync options to control when the next tick of FTextureStreamIn can be scheduled.

Return the next value StartingMipIndex (for the next provider). Must be FTextureUpdateContext::CurrentFirstMipIndex to indicate that all mips have been handled.

Implements FTextureMipDataProvider.

◆ Init()

void FTexture2DMipDataProvider_IO::Init ( const FTextureUpdateContext Context,
const FTextureUpdateSyncOptions SyncOptions 
)
finaloverridevirtual

Initialize data prelimary to the GetMips() step. Can be called several time (it does not have to advance to GetMips immediately). Mostly useful to simplify the logic in GetMips(). This is because GetMips is a chained call between all mip data providers, each taking some mips to handle, and is not compatible with multi step process. This means that GetMips() must return immediately and can not postpone or delay return by not advancing to the next steps.

Parameters
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.

Implements FTextureMipDataProvider.

◆ PollMips()

bool FTexture2DMipDataProvider_IO::PollMips ( const FTextureUpdateSyncOptions SyncOptions)
finaloverridevirtual

Check if each mip handled by this mip data provider have been updated correctly. Must move to CleanUp() or Done() when done.

Parameters
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 the mip won't be updated correctly (for example IO error).

Implements FTextureMipDataProvider.

◆ SetAsyncFileCallback()

void FTexture2DMipDataProvider_IO::SetAsyncFileCallback ( const FTextureUpdateSyncOptions SyncOptions)
protected

Member Data Documentation

◆ AsyncFileCallBack

FBulkDataIORequestCallBack FTexture2DMipDataProvider_IO::AsyncFileCallBack
protected

◆ bIORequestAborted

bool FTexture2DMipDataProvider_IO::bIORequestAborted = false
protected

◆ bIORequestCancelled

bool FTexture2DMipDataProvider_IO::bIORequestCancelled = false
protected

◆ bPrioritizedIORequest

bool FTexture2DMipDataProvider_IO::bPrioritizedIORequest = false
protected

◆ IORequests

TArray<FIORequest, TInlineAllocator<MAX_TEXTURE_MIP_COUNT> > FTexture2DMipDataProvider_IO::IORequests
protected

◆ TextureName

FName FTexture2DMipDataProvider_IO::TextureName
protected

The documentation for this class was generated from the following files: