vkd3d-shader/hlsl: Store SM4 MUL in the vsir program.

This commit is contained in:
Francisco Casas
2024-11-05 22:23:41 -03:00
committed by Henri Verbeet
parent e4d36bd855
commit 24f4308982
Notes: Henri Verbeet 2024-11-06 23:02:23 +01:00
Approved-by: Elizabeth Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1251
2 changed files with 21 additions and 19 deletions

View File

@ -8392,6 +8392,25 @@ static bool sm4_generate_vsir_instr_expr(struct hlsl_ctx *ctx,
return false;
}
case HLSL_OP2_MUL:
switch (dst_type->e.numeric.type)
{
case HLSL_TYPE_FLOAT:
generate_vsir_instr_expr_single_instr_op(ctx, program, expr, VKD3DSIH_MUL, 0, 0, true);
return true;
case HLSL_TYPE_INT:
case HLSL_TYPE_UINT:
/* Using IMUL instead of UMUL because we're taking the low
* bits, and the native compiler generates IMUL. */
sm4_generate_vsir_expr_with_two_destinations(ctx, program, VKD3DSIH_IMUL, expr, 1);
return true;
default:
hlsl_fixme(ctx, &expr->node.loc, "SM4 %s multiplication expression.", dst_type_name);
return false;
}
case HLSL_OP2_NEQUAL:
VKD3D_ASSERT(dst_type->e.numeric.type == HLSL_TYPE_BOOL);