p.Chaos.GC.ISMPoolDebugStats

p.Chaos.GC.ISMPoolDebugStats

#Overview

name: p.Chaos.GC.ISMPoolDebugStats

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

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of p.Chaos.GC.ISMPoolDebugStats is to control the display of statistics for the Instanced Static Mesh (ISM) pools in the Chaos Geometry Collection system of Unreal Engine 5.

This setting variable is primarily used in the Geometry Collection Engine module, which is part of Unreal Engine’s Chaos physics system. It specifically interacts with the debug drawing functionality for ISM pools.

The value of this variable is set through a console command, as it’s defined as a TAutoConsoleVariable. It’s initialized with a default value of 0, meaning the stats are not shown by default.

This variable interacts closely with another variable named CVarISMPoolStats. They share the same value and are used interchangeably in the code.

Developers should be aware that this variable affects the performance of the debug drawing system. Enabling it (by setting it to a non-zero value) will cause additional processing and rendering to occur, which could impact performance, especially in complex scenes.

Best practices when using this variable include:

  1. Only enable it when debugging ISM pool issues.
  2. Disable it in production builds to avoid unnecessary performance overhead.
  3. Use it in conjunction with CVarISMPoolDebugDraw for a more comprehensive debug view.

Regarding the associated variable CVarISMPoolStats:

The purpose of CVarISMPoolStats is identical to p.Chaos.GC.ISMPoolDebugStats. It’s used internally within the C++ code to reference the console variable.

This variable is used in the GeometryCollectionISMPoolDebugDrawComponent to control whether ISM pool stats should be displayed. It’s checked in several places to determine if debug information should be rendered or if the tick function should be enabled.

The value of CVarISMPoolStats is set through the console command p.Chaos.GC.ISMPoolDebugStats.

CVarISMPoolStats interacts with CVarISMPoolDebugDraw in determining whether the debug component should be ticked and what information should be displayed.

Developers should be aware that changes to CVarISMPoolStats will trigger a call to UGeometryCollectionISMPoolDebugDrawComponent::UpdateAllTickEnabled(), potentially affecting all instances of this debug component.

Best practices for CVarISMPoolStats are the same as for p.Chaos.GC.ISMPoolDebugStats, as they are essentially the same variable accessed in different ways.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Public/GeometryCollection/GeometryCollectionISMPoolDebugDrawComponent.cpp:23

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarISMPoolStats(
	TEXT("p.Chaos.GC.ISMPoolDebugStats"),
	0,
	TEXT("Show stats for the ISM pools"),
	FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* InVariable) { UGeometryCollectionISMPoolDebugDrawComponent::UpdateAllTickEnabled(); }),
	ECVF_Default);

static TAutoConsoleVariable<int32> CVarISMPoolDebugDraw(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Public/GeometryCollection/GeometryCollectionISMPoolDebugDrawComponent.cpp:22

Scope: file

Source code excerpt:

#include UE_INLINE_GENERATED_CPP_BY_NAME(GeometryCollectionISMPoolDebugDrawComponent)

static TAutoConsoleVariable<int32> CVarISMPoolStats(
	TEXT("p.Chaos.GC.ISMPoolDebugStats"),
	0,
	TEXT("Show stats for the ISM pools"),
	FConsoleVariableDelegate::CreateLambda([](IConsoleVariable* InVariable) { UGeometryCollectionISMPoolDebugDrawComponent::UpdateAllTickEnabled(); }),
	ECVF_Default);

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Public/GeometryCollection/GeometryCollectionISMPoolDebugDrawComponent.cpp:76

Scope (from outer to inner):

file
function     void UGeometryCollectionISMPoolDebugDrawComponent::UpdateTickEnabled

Source code excerpt:

void UGeometryCollectionISMPoolDebugDrawComponent::UpdateTickEnabled()
{
	const bool bForceShowStats = CVarISMPoolStats.GetValueOnAnyThread() != 0;
	const bool bForceShowBounds = CVarISMPoolDebugDraw.GetValueOnAnyThread() != 0;
	PrimaryComponentTick.SetTickFunctionEnable(bShowStats || bForceShowStats || bShowBounds || bForceShowBounds);
}

void UGeometryCollectionISMPoolDebugDrawComponent::UpdateAllTickEnabled()
{

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Public/GeometryCollection/GeometryCollectionISMPoolDebugDrawComponent.cpp:134

Scope (from outer to inner):

file
function     void UGeometryCollectionISMPoolDebugDrawComponent::TickComponent

Source code excerpt:

	UInstancedStaticMeshComponent const* FoundISM = nullptr;

	const bool bForceShowStats = CVarISMPoolStats.GetValueOnAnyThread() != 0;
	const bool bForceShowBounds = CVarISMPoolDebugDraw.GetValueOnAnyThread() != 0;
	if (bShowStats || bForceShowStats || bShowBounds || bForceShowBounds)
	{
#if WITH_EDITOR
		if (GCurrentLevelEditingViewportClient)
		{

#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Public/GeometryCollection/GeometryCollectionISMPoolDebugDrawComponent.cpp:272

Scope (from outer to inner):

file
function     void UGeometryCollectionISMPoolDebugDrawComponent::GetOnScreenMessages

Source code excerpt:

void UGeometryCollectionISMPoolDebugDrawComponent::GetOnScreenMessages(TMultiMap<FCoreDelegates::EOnScreenMessageSeverity, FText>& OutMessages)
{
	const bool bForceShowStats = CVarISMPoolStats.GetValueOnAnyThread() != 0;
	if (!bShowStats && !bShowGlobalStats && !bForceShowStats)
	{
		return;
	}

	if (bShowGlobalStats || bForceShowStats)