GeometryCache.OffloadUpdate
GeometryCache.OffloadUpdate
#Overview
name: GeometryCache.OffloadUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Offloat some updates from the render thread to the workers & RHI threads.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of GeometryCache.OffloadUpdate is to control offloading of certain update operations from the render thread to worker and RHI threads in the Geometry Cache system of Unreal Engine 5.
This setting variable is primarily used within the Geometry Cache plugin, which is part of Unreal Engine’s runtime modules. Specifically, it’s utilized in the GeometryCache subsystem, which handles the management and rendering of geometry caches.
The value of this variable is set through a console variable (CVar) system. It’s defined as a TAutoConsoleVariable with an initial value of 0, meaning the offloading is disabled by default.
The associated variable CVarOffloadUpdate directly interacts with GeometryCache.OffloadUpdate. It’s the C++ representation of the console variable and is used to access the value set by GeometryCache.OffloadUpdate.
Developers must be aware that this variable affects the threading behavior of geometry cache updates. When enabled (set to a non-zero value), it moves some update operations off the render thread, which can potentially improve performance but may also introduce threading complexities.
Best practices when using this variable include:
- Testing thoroughly with both enabled and disabled states to ensure stability and performance gains.
- Considering the impact on different hardware configurations, as the benefits may vary.
- Using it in conjunction with profiling tools to measure its effect on render thread performance.
Regarding the associated variable CVarOffloadUpdate:
- Its purpose is to provide a programmatic interface to the GeometryCache.OffloadUpdate setting.
- It’s used within the GeometryCacheSceneProxy class to determine whether to offload updates.
- The value is typically read on the render thread using GetValueOnRenderThread().
- Developers should be cautious about accessing this variable from multiple threads and ensure thread-safe access when necessary.
- Best practices include using the appropriate thread-safe getter methods and avoiding direct manipulation of the variable outside of the intended console variable system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/GeometryCacheSceneProxy.cpp:30
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarOffloadUpdate(
TEXT("GeometryCache.OffloadUpdate"),
0,
TEXT("Offloat some updates from the render thread to the workers & RHI threads."),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarInterpolateFrames(
TEXT("GeometryCache.InterpolateFrames"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarOffloadUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/GeometryCacheSceneProxy.cpp:29
Scope: file
Source code excerpt:
DECLARE_CYCLE_STAT(TEXT("InterpolateFrames"), STAT_InterpolateFrames, STATGROUP_GeometryCache);
static TAutoConsoleVariable<int32> CVarOffloadUpdate(
TEXT("GeometryCache.OffloadUpdate"),
0,
TEXT("Offloat some updates from the render thread to the workers & RHI threads."),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarInterpolateFrames(
#Loc: <Workspace>/Engine/Plugins/Runtime/GeometryCache/Source/GeometryCache/Private/GeometryCacheSceneProxy.cpp:1214
Scope (from outer to inner):
file
function void FGeometryCacheSceneProxy::FrameUpdate
Source code excerpt:
#if 0
bool bOffloadUpdate = CVarOffloadUpdate.GetValueOnRenderThread() != 0;
if (TrackProxy->SampleIndex != TrackProxy->UploadedSampleIndex)
{
TrackProxy->UploadedSampleIndex = TrackProxy->SampleIndex;
if (bOffloadUpdate)
{