r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes

r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes

#Overview

name: r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes

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.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes is to control the amount of memory allocated for bottom-level voxel hashing in the heterogeneous volumes rendering system. This setting is specifically used for deduplication in the tessellation process of heterogeneous volumes.

This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the HeterogeneousVolumes subsystem. It’s part of the voxel grid pipeline for rendering heterogeneous volumes.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 64 megabytes, but can be changed at runtime through console commands or configuration files.

The associated variable CVarHeterogeneousVolumesBottomLevelGridVoxelHashingMemoryInMegabytes directly interacts with this setting. It’s used to access and modify the value of the setting within the C++ code.

Developers must be aware that this variable affects memory usage and potentially performance of the heterogeneous volumes rendering system. Increasing this value may improve deduplication efficiency but at the cost of higher memory usage.

Best practices when using this variable include:

  1. Monitor performance and memory usage when adjusting this value.
  2. Consider the target hardware capabilities when setting this value.
  3. Balance between deduplication efficiency and memory usage based on the specific needs of your project.

Regarding the associated variable CVarHeterogeneousVolumesBottomLevelGridVoxelHashingMemoryInMegabytes:

The purpose of this variable is to provide a programmatic interface to access and modify the r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes setting within the C++ code.

This variable is used in the Renderer module, specifically in the HeterogeneousVolumes namespace.

The value of this variable is set through the CVar system and can be accessed using the GetValueOnRenderThread() method.

This variable directly interacts with the r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes setting, serving as its representation in the C++ code.

Developers should be aware that changes to this variable will directly affect the memory allocation for voxel hashing in the heterogeneous volumes system.

Best practices include using this variable to read the current value of the setting and to implement any dynamic adjustments to the voxel hashing memory allocation based on runtime conditions.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:135

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridVoxelHashingMemoryInMegabytes(
	TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes"),
	64,
	TEXT("Enables bottom-level voxel hashing for deduplication (Default = 64)\n"),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridHomogeneousAggregation(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:134

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesBottomLevelGridVoxelHashingMemoryInMegabytes(
	TEXT("r.HeterogeneousVolumes.Tessellation.BottomLevelGrid.VoxelHashingMemoryInMegabytes"),
	64,
	TEXT("Enables bottom-level voxel hashing for deduplication (Default = 64)\n"),
	ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:358

Scope (from outer to inner):

file
namespace    HeterogeneousVolumes
function     uint32 GetVoxelHashingMemoryInMegabytes

Source code excerpt:

	uint32 GetVoxelHashingMemoryInMegabytes()
	{
		return CVarHeterogeneousVolumesBottomLevelGridVoxelHashingMemoryInMegabytes.GetValueOnRenderThread();
	}

	bool EnableHomogeneousAggregation()
	{
		return CVarHeterogeneousVolumesBottomLevelGridHomogeneousAggregation.GetValueOnRenderThread() != 0;
	}