Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/hlsl.y:
return !!add_implicit_conversion(ctx, params->instrs, ge, type, loc);
}
+static bool intrinsic_tan(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
+{
- struct hlsl_ir_node *arg = params->args[0], *sin, *cos;
- if (!(sin = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_SIN, arg, loc)))
return false;
- if (!(cos = add_unary_arithmetic_expr(ctx, params->instrs, HLSL_OP1_COS, arg, loc)))
return false;
- return !!add_binary_arithmetic_expr(ctx, params->instrs, HLSL_OP2_DIV, sin, cos, loc);
The usual coding style is to separate with empty lines these code blocks.