r.LumenScene.Lighting.AsyncCompute

r.LumenScene.Lighting.AsyncCompute

#Overview

name: r.LumenScene.Lighting.AsyncCompute

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.LumenScene.Lighting.AsyncCompute is to control whether the Lumen Scene Lighting computation runs on the async compute pipeline in Unreal Engine 5. This setting is part of the Lumen global illumination system, specifically for the scene lighting calculations.

This setting variable is primarily used by the Lumen rendering subsystem within Unreal Engine 5’s renderer module. It affects the performance and execution of the Lumen Scene Lighting computations.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of 1 (enabled).

The associated variable CVarLumenSceneLightingAsyncCompute directly interacts with r.LumenScene.Lighting.AsyncCompute. They share the same value and purpose.

Developers should be aware that:

  1. This variable affects rendering performance and should be tuned carefully.
  2. It’s marked with ECVF_Scalability, indicating it’s part of the scalability settings.
  3. It’s also marked as ECVF_RenderThreadSafe, meaning it can be safely changed from any thread.

Best practices when using this variable include:

  1. Testing performance with and without async compute enabled to determine the optimal setting for your specific scene and hardware.
  2. Considering the target hardware capabilities, as async compute may not be beneficial on all systems.
  3. Using it in conjunction with other Lumen settings for optimal performance and quality balance.

Regarding the associated variable CVarLumenSceneLightingAsyncCompute:

When working with Lumen Scene Lighting, developers should use the r.LumenScene.Lighting.AsyncCompute console variable to control the behavior, rather than directly manipulating CVarLumenSceneLightingAsyncCompute.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:53

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLumenSceneLightingAsyncCompute(
	TEXT("r.LumenScene.Lighting.AsyncCompute"),
	1,
	TEXT("Whether to run LumenSceneLighting on the compute pipe if possible."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

namespace LumenSceneLighting

#Associated Variable and Callsites

This variable is associated with another variable named CVarLumenSceneLightingAsyncCompute. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:52

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarLumenSceneLightingAsyncCompute(
	TEXT("r.LumenScene.Lighting.AsyncCompute"),
	1,
	TEXT("Whether to run LumenSceneLighting on the compute pipe if possible."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:194

Scope (from outer to inner):

file
function     bool LumenSceneLighting::UseAsyncCompute

Source code excerpt:

bool LumenSceneLighting::UseAsyncCompute(const FViewFamilyInfo& ViewFamily)
{
	return Lumen::UseAsyncCompute(ViewFamily) && CVarLumenSceneLightingAsyncCompute.GetValueOnRenderThread() != 0;
}

DECLARE_GPU_STAT(LumenSceneLighting);

void FDeferredShadingSceneRenderer::RenderLumenSceneLighting(
	FRDGBuilder& GraphBuilder,