Francisco Casas (@fcasas) commented about libs/vkd3d-shader/hlsl.y:
- char *body;
- static const char template[] =
"%s refract(%s r, %s n, float i)\n""{\n"" float d = dot(r, n);\n"" float t = 1 - i * i * (1 - d * d);\n"" return t >= 0.0 ? i * r - (i * d + sqrt(t)) * n : 0;\n""}";- if (r->data_type->class == HLSL_CLASS_MATRIX)
- {
hlsl_error(ctx, loc, VKD3D_SHADER_ERROR_HLSL_INVALID_TYPE, "Invalid argument type.");return false;- }
If we check that `r` is not a matrix (like native does), I think we should also do it for `n`.