Does two outlets on a CustomHLSL node cause function redefinition error?

I’m trying to read from a StructuredBuffer type GraphicsBuffer using a CustomHLSL node. The buffer contains position at xyz and size at w, so I’ve defined two out parameters, and connected the node to two Update Particle Block sub nodes; SetPosition and SetSize.

I get this error:

redefinition of 'ReadSimplexPointFunction_B96021B' at kernel CSMain

Since the compilation failed, I can’t look at the compiled shader code, but my guess is that VFXGraph is pasting in the HLSL function twice because it’s connected to two inlets. Perhaps. Or what am I missing?

Here is the custom HLSL code

void ReadSimplexPointFunction( in int spawnIndex, in StructuredBuffer<uint> indexBuffer,  in StructuredBuffer<float4> pointBuffer, out float3 position, out float size )
{
	position = float3( 10, 0, 0 );
	size = 1;
	int index = indexBuffer[ spawnIndex ];
	if( index == 0 ) return;

	float4 posSize = pointBuffer[ index-1 ]; // Indices are stored with a +1 offset
	position = posSize.xyz;
	size = posSize.w;
}

Hello,

Thanks for reporting this issue, we were able to reproduce it.
You can follow the resolution progress through this ticket:

In the meantime, you can duplicate your output and rename the inner function in the cloned code to work around the problem.

Hello, an alternative workaround (until a proper fix is released) could be to output directly a float4 (a single value). In your case it even makes sense, since you already pack the size value in the w float4 w component. Then you simply connect xyz to the Set Position and w to Set Size.

Just to let you know that the issue has been resolved in 6000.1.0a2.

Have a great day