Lyra.DeviceProfile.Console.FrameSyncType
Lyra.DeviceProfile.Console.FrameSyncType
#Overview
name: Lyra.DeviceProfile.Console.FrameSyncType
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Sync type when being driven by device profile. Corresponds to r.GTSyncType
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of Lyra.DeviceProfile.Console.FrameSyncType is to control the frame synchronization type for console devices in the Lyra game project. This setting is specifically related to the rendering system and frame pacing.
This setting variable is primarily used in the Lyra game project, which is likely built on top of Unreal Engine 5. It’s referenced in the LyraSettingsLocal module, which is part of the LyraGame subsystem.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of -1, which likely indicates that no specific frame sync type is set by default.
This variable interacts closely with its associated variable CVarDeviceProfileDrivenFrameSyncType. They share the same value and are used together to determine the frame sync type.
Developers must be aware that this variable corresponds to the r.GTSyncType setting in Unreal Engine. It’s specifically designed for console device profiles, so it may not apply to all platforms.
Best practices when using this variable include:
- Only modify it when specifically targeting console platforms.
- Understand the implications of different frame sync types on performance and visual quality.
- Test thoroughly on target console hardware after making changes.
Regarding the associated variable CVarDeviceProfileDrivenFrameSyncType:
The purpose of CVarDeviceProfileDrivenFrameSyncType is to provide a programmatic way to access and modify the frame sync type setting. It’s used internally by the Lyra game code to apply the frame sync settings.
This variable is used in the UpdateConsoleFramePacing function of the ULyraSettingsLocal class. When its value is not -1, it’s used to set the frame sync mode using the SetSyncTypeCVar function.
Developers should be aware that changing this variable will directly affect the game’s frame synchronization behavior on console platforms. It’s important to use this in conjunction with proper device profile settings and to understand the performance implications of different sync types.
Best practices for using CVarDeviceProfileDrivenFrameSyncType include:
- Use it in conjunction with device profiles to ensure consistent behavior across different console hardware.
- Monitor performance metrics when adjusting this value to ensure optimal frame pacing.
- Consider exposing this setting in a debug menu for easier testing and adjustment during development.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:60
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenFrameSyncType(
TEXT("Lyra.DeviceProfile.Console.FrameSyncType"),
-1,
TEXT("Sync type when being driven by device profile. Corresponds to r.GTSyncType"),
ECVF_Default | ECVF_Preview);
//////////////////////////////////////////////////////////////////////
// Mobile frame pacing
#Associated Variable and Callsites
This variable is associated with another variable named CVarDeviceProfileDrivenFrameSyncType
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:59
Scope: file
Source code excerpt:
ECVF_Default | ECVF_Preview);
static TAutoConsoleVariable<int32> CVarDeviceProfileDrivenFrameSyncType(
TEXT("Lyra.DeviceProfile.Console.FrameSyncType"),
-1,
TEXT("Sync type when being driven by device profile. Corresponds to r.GTSyncType"),
ECVF_Default | ECVF_Preview);
//////////////////////////////////////////////////////////////////////
#Loc: <Workspace>/Projects/Lyra/Source/LyraGame/Settings/LyraSettingsLocal.cpp:1708
Scope (from outer to inner):
file
function void ULyraSettingsLocal::UpdateConsoleFramePacing
Source code excerpt:
{
// Apply device-profile-driven frame sync and frame pace
const int32 FrameSyncType = CVarDeviceProfileDrivenFrameSyncType.GetValueOnGameThread();
if (FrameSyncType != -1)
{
UE_LOG(LogConsoleResponse, Log, TEXT("Setting frame sync mode to %d."), FrameSyncType);
SetSyncTypeCVar(FrameSyncType);
}