Plasma Engine  2.0
Loading...
Searching...
No Matches
ExpressionByteCode_inl.h
1
2PL_ALWAYS_INLINE const plExpressionByteCode::StorageType* plExpressionByteCode::GetByteCodeStart() const
3{
4 return m_pByteCode;
5}
6
7PL_ALWAYS_INLINE const plExpressionByteCode::StorageType* plExpressionByteCode::GetByteCodeEnd() const
8{
9 return m_pByteCode + m_uiByteCodeCount;
10}
11
12PL_ALWAYS_INLINE plArrayPtr<const plExpressionByteCode::StorageType> plExpressionByteCode::GetByteCode() const
13{
14 return plMakeArrayPtr(m_pByteCode, m_uiByteCodeCount);
15}
16
17PL_ALWAYS_INLINE plUInt32 plExpressionByteCode::GetNumInstructions() const
18{
19 return m_uiNumInstructions;
20}
21
22PL_ALWAYS_INLINE plUInt32 plExpressionByteCode::GetNumTempRegisters() const
23{
24 return m_uiNumTempRegisters;
25}
26
27PL_ALWAYS_INLINE plArrayPtr<const plExpression::StreamDesc> plExpressionByteCode::GetInputs() const
28{
29 return plMakeArrayPtr(m_pInputs, m_uiNumInputs);
30}
31
32PL_ALWAYS_INLINE plArrayPtr<const plExpression::StreamDesc> plExpressionByteCode::GetOutputs() const
33{
34 return plMakeArrayPtr(m_pOutputs, m_uiNumOutputs);
35}
36
37PL_ALWAYS_INLINE plArrayPtr<const plExpression::FunctionDesc> plExpressionByteCode::GetFunctions() const
38{
39 return plMakeArrayPtr(m_pFunctions, m_uiNumFunctions);
40}
41
42// static
43PL_ALWAYS_INLINE plExpressionByteCode::OpCode::Enum plExpressionByteCode::GetOpCode(const StorageType*& ref_pByteCode)
44{
45 plUInt32 uiOpCode = *ref_pByteCode;
46 ++ref_pByteCode;
47 return static_cast<OpCode::Enum>((uiOpCode >= 0 && uiOpCode < OpCode::Count) ? uiOpCode : 0);
48}
49
50// static
51PL_ALWAYS_INLINE plUInt32 plExpressionByteCode::GetRegisterIndex(const StorageType*& ref_pByteCode)
52{
53 plUInt32 uiIndex = *ref_pByteCode;
54 ++ref_pByteCode;
55 return uiIndex;
56}
57
58// static
59PL_ALWAYS_INLINE plExpression::Register plExpressionByteCode::GetConstant(const StorageType*& ref_pByteCode)
60{
62 r.i = plSimdVec4i(*ref_pByteCode);
63 ++ref_pByteCode;
64 return r;
65}
66
67// static
68PL_ALWAYS_INLINE plUInt32 plExpressionByteCode::GetFunctionIndex(const StorageType*& ref_pByteCode)
69{
70 plUInt32 uiIndex = *ref_pByteCode;
71 ++ref_pByteCode;
72 return uiIndex;
73}
74
75// static
76PL_ALWAYS_INLINE plUInt32 plExpressionByteCode::GetFunctionArgCount(const StorageType*& ref_pByteCode)
77{
78 plUInt32 uiArgCount = *ref_pByteCode;
79 ++ref_pByteCode;
80 return uiArgCount;
81}
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
A SIMD 4-component vector class of signed 32b integers.
Definition SimdVec4i.h:9
Definition ExpressionDeclarations.h:17