Commit ab2b9a23 by Arun Patole Committed by Jamie Madill

Refactor unary operation constant folding code

This change splits TIntermConstantUnion::foldUnary into two functions: - foldUnaryWithDifferentReturnType: - Handles constant folding of operations where the return type has a different number of components compared to the operand type. - foldUnaryWithSameReturnType: - Handles constant folding of unary operations where the return type is the same as operand type. BUG=angleproject:913 TEST=angle_unittests, dEQP Tests (dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.*) Change-Id: I675891138d4e17fd2390c03e9f710e0be0b7c7b6 Reviewed-on: https://chromium-review.googlesource.com/283464Reviewed-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent cdfa8f50
...@@ -300,7 +300,8 @@ class TIntermConstantUnion : public TIntermTyped ...@@ -300,7 +300,8 @@ class TIntermConstantUnion : public TIntermTyped
virtual bool replaceChildNode(TIntermNode *, TIntermNode *) { return false; } virtual bool replaceChildNode(TIntermNode *, TIntermNode *) { return false; }
TConstantUnion *foldBinary(TOperator op, TIntermConstantUnion *rightNode, TInfoSink &infoSink); TConstantUnion *foldBinary(TOperator op, TIntermConstantUnion *rightNode, TInfoSink &infoSink);
TConstantUnion *foldUnary(TOperator op, TInfoSink &infoSink); TConstantUnion *foldUnaryWithDifferentReturnType(TOperator op, TInfoSink &infoSink);
TConstantUnion *foldUnaryWithSameReturnType(TOperator op, TInfoSink &infoSink);
static TConstantUnion *FoldAggregateBuiltIn(TIntermAggregate *aggregate, TInfoSink &infoSink); static TConstantUnion *FoldAggregateBuiltIn(TIntermAggregate *aggregate, TInfoSink &infoSink);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment