3#include <Foundation/CodeUtils/Expression/ExpressionDeclarations.h>
4#include <Foundation/Memory/LinearAllocator.h>
13 using StorageType = plUInt8;
102 static bool IsUnary(Enum nodeType);
103 static bool IsBinary(Enum nodeType);
104 static bool IsTernary(Enum nodeType);
105 static bool IsConstant(Enum nodeType);
106 static bool IsSwizzle(Enum nodeType);
107 static bool IsInput(Enum nodeType);
108 static bool IsOutput(Enum nodeType);
109 static bool IsFunctionCall(Enum nodeType);
110 static bool IsConstructorCall(Enum nodeType);
112 static bool IsCommutative(Enum nodeType);
113 static bool AlwaysReturnsSingleElement(Enum nodeType);
115 static const char* GetName(Enum nodeType);
120 using StorageType = plUInt8;
153 PL_ALWAYS_INLINE
static plExpression::RegisterType::Enum GetRegisterType(Enum dataType)
155 return static_cast<plExpression::RegisterType::Enum
>(dataType >> 2);
158 PL_ALWAYS_INLINE
static Enum FromRegisterType(plExpression::RegisterType::Enum registerType, plUInt32 uiElementCount = 1)
160 return static_cast<plExpressionAST::DataType::Enum
>((registerType << 2) + uiElementCount - 1);
163 PL_ALWAYS_INLINE
static plUInt32 GetElementCount(Enum dataType) {
return (dataType & 0x3) + 1; }
165 static const char* GetName(Enum dataType);
170 using StorageType = plUInt8;
189 static const char* GetName(Enum vectorComponent);
191 static Enum FromChar(plUInt32 uiChar);
198 plUInt8 m_uiOverloadIndex = 0xFF;
199 plUInt8 m_uiNumInputElements = 0;
201 plUInt32 m_uiHash = 0;
206 Node* m_pOperand =
nullptr;
211 Node* m_pLeftOperand =
nullptr;
212 Node* m_pRightOperand =
nullptr;
217 Node* m_pFirstOperand =
nullptr;
218 Node* m_pSecondOperand =
nullptr;
219 Node* m_pThirdOperand =
nullptr;
230 plUInt32 m_NumComponents = 0;
231 Node* m_pExpression =
nullptr;
242 Node* m_pExpression =
nullptr;
260 UnaryOperator* CreateUnaryOperator(NodeType::Enum type,
Node* pOperand, DataType::Enum returnType = DataType::Unknown);
263 Constant* CreateConstant(
const plVariant& value, DataType::Enum dataType = DataType::Float);
283 Node* TypeDeductionAndConversion(
Node* pNode);
284 Node* ReplaceVectorInstructions(
Node* pNode);
285 Node* ScalarizeVectorInstructions(
Node* pNode);
286 Node* ReplaceUnsupportedInstructions(
Node* pNode);
288 Node* CommonSubexpressionElimination(
Node* pNode);
295 void ResolveOverloads(
Node* pNode);
297 static DataType::Enum GetExpectedChildDataType(
const Node* pNode, plUInt32 uiChildIndex);
299 static void UpdateHash(
Node* pNode);
300 static bool IsEqual(
const Node* pNodeA,
const Node* pNodeB);
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
This class encapsulates building a DGML compatible graph.
Definition DGMLWriter.h:10
Definition ExpressionAST.h:9
Definition HashTable.h:333
Definition LinearAllocator.h:12
DataType
The data types which can be stored in the stream. When adding new data types the GetDataTypeSize() of...
Definition ProcessingStream.h:13
Definition SmallArray.h:219
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Describes an expression function and its signature, e.g. how many input parameter it has and their ty...
Definition ExpressionDeclarations.h:72
Describes an input or output stream for a expression VM.
Definition ExpressionDeclarations.h:57
Definition ExpressionAST.h:210
Definition ExpressionAST.h:223
Definition ExpressionAST.h:252
Definition ExpressionAST.h:119
Definition ExpressionAST.h:246
Definition ExpressionAST.h:195
Definition ExpressionAST.h:12
Definition ExpressionAST.h:240
Definition ExpressionAST.h:228
Definition ExpressionAST.h:216
Definition ExpressionAST.h:205
Definition ExpressionAST.h:169
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Enum
This enum describes the type of data that is currently stored inside the variant. Note that changes t...
Definition VariantType.h:26