UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RenderResource.cpp File Reference
#include "RenderResource.h"
#include "Misc/App.h"
#include "RHI.h"
#include "RenderingThread.h"
#include "ProfilingDebugging/LoadTimeTracker.h"
#include "CoreGlobals.h"
#include "RenderGraphResources.h"
#include "Containers/ResourceArray.h"
#include "RenderCore.h"
#include "Async/RecursiveMutex.h"

Classes

class  FRenderResourceList
 
struct  FBatchedReleaseResources
 
class  FTextureSamplerStateCache
 

Functions

void BeginInitResource (FRenderResource *Resource, FRenderCommandPipe *RenderCommandPipe)
 
void BeginUpdateResourceRHI (FRenderResource *Resource, FRenderCommandPipe *RenderCommandPipe)
 
void StartBatchedRelease ()
 
void EndBatchedRelease ()
 
void BeginReleaseResource (FRenderResource *Resource, FRenderCommandPipe *RenderCommandPipe)
 
void ReleaseResourceAndFlush (FRenderResource *Resource)
 

Variables

float GEnableMipLevelFading = 1.0f
 
TGlobalResource< FTextureSamplerStateCacheGTextureSamplerStateCache
 
int32 GTextureReferenceRevertsLastRenderContainer = 1
 
FAutoConsoleVariableRef CVarTextureReferenceRevertsLastRenderContainer (TEXT("r.TextureReferenceRevertsLastRenderContainer"), GTextureReferenceRevertsLastRenderContainer, TEXT(""))
 
FMipFadeSettings GMipFadeSettings [MipFade_NumSettings]
 
float GMipLevelFadingAgeThreshold = 0.5f
 

Function Documentation

◆ BeginInitResource()

void BeginInitResource ( FRenderResource Resource,
FRenderCommandPipe RenderCommandPipe = nullptr 
)

Sends a message to the rendering thread to initialize a resource. This is called in the game thread.

◆ BeginReleaseResource()

void BeginReleaseResource ( FRenderResource Resource,
FRenderCommandPipe RenderCommandPipe = nullptr 
)

Sends a message to the rendering thread to release a resource. This is called in the game thread.

◆ BeginUpdateResourceRHI()

void BeginUpdateResourceRHI ( FRenderResource Resource,
FRenderCommandPipe RenderCommandPipe = nullptr 
)

Sends a message to the rendering thread to update a resource. This is called in the game thread.

◆ EndBatchedRelease()

void EndBatchedRelease ( )

Disables the batching of calls to BeginReleaseResource This is called in the game thread.

◆ ReleaseResourceAndFlush()

void ReleaseResourceAndFlush ( FRenderResource Resource)

Sends a message to the rendering thread to release a resource, and spins until the rendering thread has processed the message. This is called in the game thread.

◆ StartBatchedRelease()

void StartBatchedRelease ( )

Enables the batching of calls to BeginReleaseResource This is called in the game thread.

Variable Documentation

◆ CVarTextureReferenceRevertsLastRenderContainer

FAutoConsoleVariableRef CVarTextureReferenceRevertsLastRenderContainer(TEXT("r.TextureReferenceRevertsLastRenderContainer"), GTextureReferenceRevertsLastRenderContainer, TEXT("")) ( TEXT("r.TextureReferenceRevertsLastRenderContainer")  ,
GTextureReferenceRevertsLastRenderContainer  ,
TEXT("")   
)

◆ GEnableMipLevelFading

float GEnableMipLevelFading = 1.0f

Whether to enable mip-level fading or not: +1.0f if enabled, -1.0f if disabled.

◆ GMipFadeSettings

Initial value:
=
{
FMipFadeSettings(0.3f, 0.1f),
FMipFadeSettings(2.0f, 1.0f)
}
Definition RenderResource.h:269

Global mip fading settings, indexed by EMipFadeSettings.

◆ GMipLevelFadingAgeThreshold

float GMipLevelFadingAgeThreshold = 0.5f

How "old" a texture must be to be considered a "new texture", in seconds.

◆ GTextureReferenceRevertsLastRenderContainer

int32 GTextureReferenceRevertsLastRenderContainer = 1

◆ GTextureSamplerStateCache

TGlobalResource<FTextureSamplerStateCache> GTextureSamplerStateCache