Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

5.11.1

Issue ID

1146516

Regression

No

[VFXExpression] VFXEXpressionCombine doesn't handle different number of components

Package: Visual Effect Graph

-

TL;DR: VFXExpressionCombine(float2, float) does not combine to a float3.

An edge, but harder to track issue is that if the produced value is indirectly used, no error will appear with the expression, but there will be a compilation error:
incorrect number of arguments to numeric-type constructor at kernel CSMain

Repro steps:
1. Import the attached files into the VFX package
(The issue is with PositionDepthNode, it is dependent on the VFXExpressionLoadTexture2D expression and the VFXExpressionTransformVector4 expression within VFXExpressionTransform.cs) Note: VFXExpressionTransform.cs already exists, so it'll have to be replaced.

2. Attach the node to a VFX graph and compile it
3. Observe the incorrect number of arguments error in the console.

In this case this:
var uv = new VFXExpressionCombine(new VFXExpressionRandom(true), new VFXExpressionRandom(true));
var uvs = new VFXExpressionCombine(uv, VFXValue.Constant(0f));

Gets compiled to:
//uv
float tmp_z = RAND;
float tmp_ba = RAND;
float2 tmp_bb = float2(tmp_z, tmp_ba);
//uvs
float2 tmp_bj = float2(tmp_bb, (float)0);

float2 tmp_bj should be a float3.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.