Francisco Casas (@fcasas) commented about libs/vkd3d-shader/hlsl_codegen.c:
+ if (!(replacement = hlsl_new_expr(ctx, HLSL_OP3_DP2ADD, operands, instr->data_type, &expr->node.loc))) + return false; + } + else + { + if (!(mul = hlsl_new_binary_expr(ctx, HLSL_OP2_MUL, expr->operands[0].node, expr->operands[1].node))) + return false; + list_add_before(&instr->entry, &mul->entry); + + if (!(add_x = hlsl_new_swizzle(ctx, HLSL_SWIZZLE(X, X, X, X), instr->data_type->dimx, mul, &expr->node.loc))) + return false; + list_add_before(&instr->entry, &add_x->node.entry); + + if (!(add_y = hlsl_new_swizzle(ctx, HLSL_SWIZZLE(Y, Y, Y, Y), instr->data_type->dimx, mul, &expr->node.loc))) + return false; + list_add_before(&instr->entry, &add_y->node.entry); nitpick: for both calls to `hlsl_new_swizzle()`, `instr->data_type->dimx` could just be `1`, right?
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/74#note_22645