I tried several input values and I don't see differences between the results, so I guess the implementation is correct.
However, we still have to fix some problems regarding type checking, for instance, I tried this: ```hlsl float4 main() : sv_target { float4 r = {-1.0, 0.0, -0.4, -0.6}; float3 n = {0.6, 0.4, -0.3}; float i = -1.2;
float4 res = refract(r, n, i);
return res; } ``` and our compiler throws ``` vkd3d:129954:fixme:fold_cast Cast from float3 to float4. vkd3d:129954:fixme:fold_cast Cast from float3 to float4. vkd3d:129954:fixme:fold_cast Cast from float3 to float4. vkd3d:129954:fixme:fold_cast Cast from float3 to float4. vkd3d-compiler: /home/fcasas/Music/vkd3d/libs/vkd3d-shader/tpf.c:4586: write_sm4_cast: Assertion `src_type->dimx == dst_type->dimx' failed. Aborted (core dumped) ```
This happens because add_user_call() is not performing the implicit_compatible_data_types() type checks that add_call() does through find_function_call().
I am not sure what is the best solution for this, maybe also adding these checks into hlsl_compile_internal_function() ?