r.Bloom.AsyncCompute
r.Bloom.AsyncCompute
#Overview
name: r.Bloom.AsyncCompute
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to run FFT bloom on async compute.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Bloom.AsyncCompute is to control whether the Fast Fourier Transform (FFT) bloom effect is computed asynchronously using the GPU’s async compute capabilities. This setting variable is primarily used in the rendering system, specifically for post-processing effects.
This setting variable is relied upon by the Renderer module of Unreal Engine, particularly in the post-processing subsystem that handles bloom effects.
The value of this variable is set through a console variable (CVarAsynComputeFFTBloom) in the Renderer module. It’s initialized with a default value of 1, meaning async compute for FFT bloom is enabled by default.
The associated variable CVarAsynComputeFFTBloom directly interacts with r.Bloom.AsyncCompute. They share the same value and purpose.
Developers must be aware that this variable affects the performance and potentially the visual quality of the bloom effect. When enabled, it can improve performance by offloading the FFT bloom computation to async compute pipelines, but this might not be beneficial on all hardware.
Best practices when using this variable include:
- Testing the performance impact on target hardware, as async compute benefits can vary between different GPUs.
- Considering the overall renderer workload when deciding to enable or disable this feature.
- Being aware that changing this setting at runtime might cause a brief stutter as the renderer adjusts its pipelines.
Regarding the associated variable CVarAsynComputeFFTBloom:
- Its purpose is identical to r.Bloom.AsyncCompute, serving as the internal representation of the console variable.
- It’s used directly in the FFT bloom pass setup to determine whether to use async compute.
- The value is retrieved on the render thread, indicating that changes to this variable are safe to make dynamically.
- Developers should be aware that this variable is marked as render thread safe (ECVF_RenderThreadSafe), meaning it can be changed at runtime without causing threading issues.
When working with both r.Bloom.AsyncCompute and CVarAsynComputeFFTBloom, developers should treat them as a single entity, as changes to one will affect the other. The console variable provides a way for users or developers to adjust the setting at runtime or through configuration files, while the C++ variable allows for programmatic access to the setting within the engine’s code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessFFTBloom.cpp:24
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarAsynComputeFFTBloom(
TEXT("r.Bloom.AsyncCompute"), 1,
TEXT("Whether to run FFT bloom on async compute.\n"),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarBloomWarnKernelResolution(
TEXT("r.Bloom.WarnKernelResolution"), 1,
TEXT("Whether to emit a warning when the resolution of the kernel is unecessary to high.\n")
#Associated Variable and Callsites
This variable is associated with another variable named CVarAsynComputeFFTBloom
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessFFTBloom.cpp:23
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarAsynComputeFFTBloom(
TEXT("r.Bloom.AsyncCompute"), 1,
TEXT("Whether to run FFT bloom on async compute.\n"),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarBloomWarnKernelResolution(
TEXT("r.Bloom.WarnKernelResolution"), 1,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessFFTBloom.cpp:786
Scope (from outer to inner):
file
function FFFTBloomOutput AddFFTBloomPass
Source code excerpt:
Intermediates.bDoHorizontalFirst = ((Intermediates.FrequencySize.Y * PaddedImageSize.X) > (Intermediates.FrequencySize.X * PaddedImageSize.Y));
Intermediates.ComputePassFlags = (GSupportsEfficientAsyncCompute && CVarAsynComputeFFTBloom.GetValueOnRenderThread() != 0) ? ERDGPassFlags::AsyncCompute : ERDGPassFlags::Compute;
}
RDG_EVENT_SCOPE(GraphBuilder, "Bloom %dx%d", Intermediates.ImageSize.X, Intermediates.ImageSize.Y);
// Downscale the input to the final resolution fraction
FScreenPassTextureSlice FFTInputSceneColor;