You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Move ComputeFramework into its own plugin. #preflight 619bddd0f934c1a291daae39 #ROBOMERGE-AUTHOR: jeremy.moore #ROBOMERGE-SOURCE: CL 18262262 in //UE5/Release-5.0/... via CL 18262318 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18262322 by jeremy moore in ue5-release-engine-test branch]
44 lines
1010 B
C++
44 lines
1010 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ComputeSystemInterface.h"
|
|
|
|
namespace ComputeSystemInterface
|
|
{
|
|
TArray<IComputeSystem*> GRegisteredSystems;
|
|
|
|
void RegisterSystem(IComputeSystem* InSystem)
|
|
{
|
|
GRegisteredSystems.AddUnique(InSystem);
|
|
}
|
|
|
|
void UnregisterSystem(IComputeSystem* InSystem)
|
|
{
|
|
for (int32 SystemIndex = 0; SystemIndex < GRegisteredSystems.Num(); ++SystemIndex)
|
|
{
|
|
if (GRegisteredSystems[SystemIndex] == InSystem)
|
|
{
|
|
GRegisteredSystems.RemoveAtSwap(SystemIndex, 1, false);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
void CreateWorkers(FSceneInterface const* InScene, TArray<IComputeTaskWorker*>& OutWorkders)
|
|
{
|
|
for (IComputeSystem* System : GRegisteredSystems)
|
|
{
|
|
System->CreateWorkers(InScene, OutWorkders);
|
|
}
|
|
}
|
|
|
|
void DestroyWorkers(FSceneInterface const* InScene, TArray<IComputeTaskWorker*>& InOutWorkders)
|
|
{
|
|
for (IComputeSystem* System : GRegisteredSystems)
|
|
{
|
|
System->DestroyWorkers(InScene, InOutWorkders);
|
|
}
|
|
|
|
ensure(InOutWorkders.Num() == 0);
|
|
}
|
|
}
|