Files
UnrealEngineUWP/Engine/Source/Runtime/VectorVM/Private/VectorVMPrivate.h
Andrew Davidson 387d6d2ca0 LWC: Niagara uses large world coordinate float types only.
Submitted on behalf of shaun.kime.
#rb chris.conway, frank.fella, michael.galetzka, simon.tovey, stu.mckenna, andy.davidson
#preflight 60cb5af49f1237000128cbe8

[CL 16706154 by Andrew Davidson in ue5-main branch]
2021-06-17 12:39:21 -04:00

82 lines
2.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "VectorVM.h"
#define ENABLE_VM_DEBUGGING 0
struct FVectorVMContext;
namespace VectorVM
{
/** Constants. */
enum
{
MaxInstanceSizeBytes = 4,
};
}
struct FDummyHandler
{
FORCEINLINE void Advance(){ }
FORCEINLINE VectorRegister4Float Get(){ return GlobalVectorConstants::FloatZero; }
FORCEINLINE VectorRegister4Float GetValue(){ return GlobalVectorConstants::FloatZero; }
};
extern FDummyHandler DummyHandler;
//////////////////////////////////////////////////////////////////////////
// Debugger
#if ENABLE_VM_DEBUGGING
class FVectorVMDebuggerImpl
{
friend class VectorVM::FVectorVMDebugger;
FVectorVMDebuggerImpl()
: CurrOp(EVectorVMOp::done)
, OpType(VectorVM::EVMType::Vector4)
, CurrNumArgs(0)
, CurrInstanceBase(0)
, NumInstancesPerOp(0)
, StartInstance(0)
{
}
//Map of instance index to debug info gathered for that instance.
TMap<int32, TArray<VectorVM::FOpDebugInfo>> DebugInfo;
EVectorVMOp CurrOp;
VectorVM::EVMType OpType;
int32 CurrNumArgs;
int32 CurrInstanceBase;
int32 NumInstancesPerOp;
int32 StartInstance;
VectorVM::FDebugValue CachedPreOpData[NUM_VM_OP_DEBUG_VALUES];
public:
void InitForScriptRun(int32 InStartInstance, const TArray<int32> InstancesToDebug)
{
StartInstance = InStartInstance;
DebugInfo.Empty(InstancesToDebug.Num());
for (int32 i : InstancesToDebug)
{
DebugInfo.Add(i);
}
}
void BeginOp(FVectorVMContext& Context, VectorVM::EVMType InType, int32 InNumArgs, int32 InNumInstancesPerOp);
template<typename DstHandler, typename Arg0Handler, typename Arg1Handler = FDummyHandler, typename Arg2Handler = FDummyHandler, typename Arg3Handler = FDummyHandler>
void PreOp(FVectorVMContext& Context, DstHandler& Dst, Arg0Handler& Arg, Arg1Handler& Arg1 = DummyHandler, Arg2Handler& Arg2 = DummyHandler, Arg3Handler& Arg3 = DummyHandler);
template<typename DstHandler, typename Arg0Handler, typename Arg1Handler = FDummyHandler, typename Arg2Handler = FDummyHandler, typename Arg3Handler = FDummyHandler>
void PostOp(FVectorVMContext& Context, DstHandler& Dst, Arg0Handler& Arg, Arg1Handler& Arg1 = DummyHandler, Arg2Handler& Arg2 = DummyHandler, Arg3Handler& Arg3 = DummyHandler);
};
#endif