Skip to content
Snippets Groups Projects
Select Git revision
  • dd7d612c8c95543672ac3293e02a499eda773093
  • master default protected
  • develop
  • 1.3.0
  • 1.1.0
  • 1.0.0
6 results

DisplayClusterDeviceBase.cpp

Blame
  • DisplayClusterDeviceBase.cpp 13.83 KiB
    // Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
    
    #include "DisplayClusterDeviceBase.h"
    
    #include "Cluster/IPDisplayClusterClusterManager.h"
    #include "Cluster/Controller/IPDisplayClusterNodeController.h"
    #include "Config/IPDisplayClusterConfigManager.h"
    #include "Game/IPDisplayClusterGameManager.h"
    
    #include "DisplayClusterScreenComponent.h"
    
    #include "RHIStaticStates.h"
    #include "Slate/SceneViewport.h"
    
    #include "Misc/DisplayClusterHelpers.h"
    #include "Misc/DisplayClusterLog.h"
    
    #include "DisplayClusterGlobals.h"
    #include "IPDisplayCluster.h"
    
    #include <utility>
    
    
    FDisplayClusterDeviceBase::FDisplayClusterDeviceBase() :
    	FRHICustomPresent()
    {
    	UE_LOG(LogDisplayClusterRender, VeryVerbose, TEXT(".ctor FDisplayClusterDeviceBase"));
    }
    
    FDisplayClusterDeviceBase::~FDisplayClusterDeviceBase()
    {
    	UE_LOG(LogDisplayClusterRender, VeryVerbose, TEXT(".dtor FDisplayClusterDeviceBase"));
    }
    
    bool FDisplayClusterDeviceBase::Initialize()
    {
    	if (GDisplayCluster->GetOperationMode() == EDisplayClusterOperationMode::Disabled)
    	{
    		return false;
    	}
    
    	UE_LOG(LogDisplayClusterRender, Log, TEXT("Use swap interval: %d"), SwapInterval);
    
    	return true;
    }
    
    void FDisplayClusterDeviceBase::WaitForBufferSwapSync(int32& InOutSyncInterval)
    {
    	// Perform SW synchronization
    	UE_LOG(LogDisplayClusterRender, Verbose, TEXT("Waiting for swap sync..."));
    
    	// Policies below are available for any render device type
    	switch (SwapSyncPolicy)
    	{
    		case EDisplayClusterSwapSyncPolicy::None:
    		{
    			exec_BarrierWait();
    			InOutSyncInterval = 0;
    			break;
    		}
    
    		default:
    		{
    			UE_LOG(LogDisplayClusterRender, Warning, TEXT("Swap sync policy drop: %d"), (int)SwapSyncPolicy);
    			InOutSyncInterval = 0;
    			break;
    		}
    	}
    }