r.Nanite.ComputeRasterization
r.Nanite.ComputeRasterization
#Overview
name: r.Nanite.ComputeRasterization
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow compute rasterization. When disabled all rasterization will go through the hardware path.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Nanite.ComputeRasterization is to control whether compute rasterization is allowed in Unreal Engine’s Nanite system. It is primarily used for the rendering system, specifically the Nanite geometry virtualization technology.
This setting variable is relied upon by Unreal Engine’s Renderer module, particularly within the Nanite subsystem. It’s referenced in the NaniteCullRaster.cpp file, which is part of the Nanite rendering pipeline.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, meaning compute rasterization is enabled by default.
The associated variable CVarNaniteComputeRasterization directly interacts with r.Nanite.ComputeRasterization. They share the same value and purpose.
Developers must be aware that this variable affects the rasterization method used by Nanite. When enabled (set to 1), it allows compute rasterization. When disabled (set to 0), all rasterization will go through the hardware path.
Best practices when using this variable include:
- Understanding the performance implications of compute vs. hardware rasterization on your target platforms.
- Testing your game’s performance with both settings to determine which works best for your specific use case.
- Considering the interaction with other Nanite settings, such as async rasterization.
Regarding the associated variable CVarNaniteComputeRasterization:
- Its purpose is identical to r.Nanite.ComputeRasterization.
- It’s used within the Renderer module, specifically in the Nanite subsystem.
- Its value is set through the CVar system and can be changed at runtime.
- It directly interacts with the InitRasterContext function to determine the rasterization scheduling.
- Developers should be aware that changing this variable at runtime will affect the Nanite rendering pipeline.
- Best practices include using this variable for debugging or performance testing, and generally leaving it at its default value unless specific optimization is required.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteCullRaster.cpp:70
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarNaniteComputeRasterization(
TEXT("r.Nanite.ComputeRasterization"),
1,
TEXT("Whether to allow compute rasterization. When disabled all rasterization will go through the hardware path."),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarNaniteProgrammableRaster(
#Associated Variable and Callsites
This variable is associated with another variable named CVarNaniteComputeRasterization
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteCullRaster.cpp:69
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarNaniteComputeRasterization(
TEXT("r.Nanite.ComputeRasterization"),
1,
TEXT("Whether to allow compute rasterization. When disabled all rasterization will go through the hardware path."),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Nanite/NaniteCullRaster.cpp:4841
Scope (from outer to inner):
file
namespace Nanite
function FRasterContext InitRasterContext
Source code excerpt:
// Set rasterizer scheduling based on config and platform capabilities.
if (CVarNaniteComputeRasterization.GetValueOnRenderThread() != 0)
{
const bool bUseAsyncCompute = GSupportsEfficientAsyncCompute && (CVarNaniteEnableAsyncRasterization.GetValueOnRenderThread() != 0) && EnumHasAnyFlags(GRHIMultiPipelineMergeableAccessMask, ERHIAccess::UAVMask);
RasterContext.RasterScheduling = bUseAsyncCompute ? ERasterScheduling::HardwareAndSoftwareOverlap : ERasterScheduling::HardwareThenSoftware;
}
else
{