Skip to content

Commit 292a833

Browse files
PaulDemeulenaereGitHub Enterprise
authored andcommitted
Fix UInt/Int Condition Reduction (PS4/X1 issue) (#96)
* Fix missing type copy in reduce Tested locally on a PS4 * Add expection to detect unsupported value type
1 parent 55f6371 commit 292a833

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

com.unity.visualeffectgraph/Editor/Expressions/VFXExpressionFlow.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ public VFXExpressionCondition()
2222

2323
public VFXExpressionCondition(VFXValueType type, VFXCondition cond, VFXExpression left, VFXExpression right) : base(VFXExpression.Flags.None, new VFXExpression[] { left, right })
2424
{
25+
if (type != left.valueType || type != right.valueType)
26+
throw new InvalidOperationException(string.Format("Unexpected value type in condition expression : {0}/{1} (expected {2})", left.valueType, right.valueType, type));
27+
28+
if (type != VFXValueType.Float && type != VFXValueType.Uint32 && type != VFXValueType.Int32)
29+
throw new NotImplementedException("This type is not handled by condition expression: " + type);
30+
2531
condition = cond;
2632
this.type = type;
2733
}
@@ -86,6 +92,7 @@ protected override VFXExpression Reduce(VFXExpression[] reducedParents)
8692
{
8793
var newExpression = (VFXExpressionCondition)base.Reduce(reducedParents);
8894
newExpression.condition = condition;
95+
newExpression.type = type;
8996
return newExpression;
9097
}
9198

0 commit comments

Comments
 (0)