7 Sep
2023
7 Sep
'23
7:44 p.m.
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`.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/333#note_44606