Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
+static bool intrinsic_fwidth(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
+{
- struct hlsl_ir_function_decl *func;
- struct hlsl_type *type;
- char *body;
- static const char template[] =
"%s fwidth(%s x)\n"
"{\n"
" return abs(ddx(x)) + abs(ddy(x));\n"
"}";
- if (!(type = elementwise_intrinsic_get_common_type(ctx, params, loc)))
return false;
- type = hlsl_get_numeric_type(ctx, type->class, HLSL_TYPE_FLOAT, type->dimx, type->dimy);
As for the determinant, it is likely (though not necessarily true, so a test for that would be appropriate) that the right thing to do here is using `elementwise_intrinsic_float_convert_args()`.