2020-10-09 22:42:26 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "DisplayClusterConfigurationModule.h"
|
|
|
|
|
#include "DisplayClusterConfigurationMgr.h"
|
|
|
|
|
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
|
|
|
|
|
|
|
|
|
#include "Engine/Engine.h"
|
|
|
|
|
#include "Engine/Console.h"
|
|
|
|
|
|
|
|
|
|
#include "DisplayClusterConfigurationLog.h"
|
|
|
|
|
#include "DisplayClusterConfigurationStrings.h"
|
|
|
|
|
|
|
|
|
|
#include "Misc/DisplayClusterHelpers.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// IModuleInterface
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
void FDisplayClusterConfigurationModule::StartupModule()
|
|
|
|
|
{
|
|
|
|
|
FString ConfigLineStr = FCommandLine::Get();
|
|
|
|
|
|
|
|
|
|
int32 GraphicsAdapter;
|
|
|
|
|
if (DisplayClusterHelpers::str::ExtractValue(ConfigLineStr, DisplayClusterConfigurationStrings::args::Gpu, GraphicsAdapter))
|
|
|
|
|
{
|
|
|
|
|
IConsoleVariable* const GpuCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.GraphicsAdapter"));
|
|
|
|
|
if (GpuCVar)
|
|
|
|
|
{
|
|
|
|
|
UE_LOG(LogDisplayClusterConfiguration, Log, TEXT("Set custom GPU selection policy - r.GraphicsAdapter=%d"), GraphicsAdapter);
|
|
|
|
|
GpuCVar->Set(GraphicsAdapter);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// IDisplayClusterConfiguration
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////
|
2021-08-03 11:56:47 -04:00
|
|
|
|
|
|
|
|
void FDisplayClusterConfigurationModule::SetIsSnapshotTransacting(bool bIsSnapshotState)
|
|
|
|
|
{
|
|
|
|
|
bIsSnapshot = bIsSnapshotState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FDisplayClusterConfigurationModule::IsTransactingSnapshot() const
|
|
|
|
|
{
|
|
|
|
|
return bIsSnapshot;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-22 00:27:54 -04:00
|
|
|
EDisplayClusterConfigurationVersion FDisplayClusterConfigurationModule::GetConfigVersion(const FString& FilePath)
|
|
|
|
|
{
|
|
|
|
|
return FDisplayClusterConfigurationMgr::Get().GetConfigVersion(FilePath);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-22 19:19:16 -04:00
|
|
|
UDisplayClusterConfigurationData* FDisplayClusterConfigurationModule::LoadConfig(const FString& FilePath, UObject* Owner)
|
2020-10-09 22:42:26 -04:00
|
|
|
{
|
2020-10-22 19:19:16 -04:00
|
|
|
return FDisplayClusterConfigurationMgr::Get().LoadConfig(FilePath, Owner);
|
2020-10-09 22:42:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool FDisplayClusterConfigurationModule::SaveConfig(const UDisplayClusterConfigurationData* Config, const FString& FilePath)
|
|
|
|
|
{
|
|
|
|
|
return FDisplayClusterConfigurationMgr::Get().SaveConfig(Config, FilePath);
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-29 19:32:06 -04:00
|
|
|
bool FDisplayClusterConfigurationModule::ConfigAsString(const UDisplayClusterConfigurationData* Config, FString& OutString) const
|
|
|
|
|
{
|
|
|
|
|
return FDisplayClusterConfigurationMgr::Get().ConfigAsString(Config, OutString);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-09 22:42:26 -04:00
|
|
|
IMPLEMENT_MODULE(FDisplayClusterConfigurationModule, DisplayClusterConfiguration);
|