I have an effect file in XNA4, being compiled as Shader Model 3.
This line compiles fine (interpolating between 2 colours):
return lerp(float4(1,0,0,1),float4(0,0,1,1),pf.x);
Changing the green component of the first colour from 0 to 0.5:
return lerp(float4(1,0.5,0,1),float4(0,0,1,1),pf.x);
Results in a failed compilation:
error X6045: When constant registers are read multiple times in a single
instruction, the _abs modifier must either be present on all of the
constants, or none of them.
Googling for the error code returns nothing (edit: other than this question)
According to documentation all of the values which are passed to
lerp()should be of the same type and size, so maybe that will work: