HLSL: phase 2e: introduce lower level addBinaryNode/UnaryNode fns
- hlsl.struct.frag variable changed to static, assignment replacd. - Created new low level functions addBinaryNode and addUnaryNode. These are used by higher level functions such as addAssignment, and do not do any argument promotion or conversion of any sort. - Two functions above are now used in RWTexture lvalue conversions. Also, other direction creations of unary or binary nodes now use them, e.g, addIndex. This cleans up some existing code. - removed handling of EOpVectorTimesScalar from promote() - removed comment from ParseHelper.cpp
This commit is contained in:
parent
07830e805b
commit
b3da8a9cb3
6 changed files with 170 additions and 156 deletions
|
|
@ -236,6 +236,13 @@ public:
|
|||
TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&);
|
||||
TIntermTyped* addSwizzle(TVectorFields&, const TSourceLoc&);
|
||||
|
||||
// Low level functions to add nodes (no conversions or other higher level transformations)
|
||||
// If a type is provided, the node's type will be set to it.
|
||||
TIntermBinary* addBinaryNode(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc) const;
|
||||
TIntermBinary* addBinaryNode(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc, const TType&) const;
|
||||
TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc) const;
|
||||
TIntermUnary* addUnaryNode(TOperator op, TIntermTyped* child, TSourceLoc, const TType&) const;
|
||||
|
||||
// Constant folding (in Constant.cpp)
|
||||
TIntermTyped* fold(TIntermAggregate* aggrNode);
|
||||
TIntermTyped* foldConstructor(TIntermAggregate* aggrNode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue