vkd3d-shader/hlsl: Handle RSQ output for SM1.

This commit is contained in:
Nikolay Sivov 2023-01-24 15:44:09 +03:00 committed by Alexandre Julliard
parent 3e6fccdbf9
commit b84b9349bf
Notes: Alexandre Julliard 2023-01-25 22:43:43 +01:00
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/69

View File

@ -632,13 +632,14 @@ static void write_sm1_expr(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffer *b
break;
case HLSL_OP1_RCP:
case HLSL_OP1_RSQ:
for (i = 0; i < instr->data_type->dimx; ++i)
{
struct hlsl_reg src = arg1->reg, dst = instr->reg;
src.writemask = hlsl_combine_writemasks(src.writemask, 1u << i);
dst.writemask = hlsl_combine_writemasks(dst.writemask, 1u << i);
write_sm1_unary_op(ctx, buffer, D3DSIO_RCP, &dst, &src, 0);
write_sm1_unary_op(ctx, buffer, expr->op == HLSL_OP1_RCP ? D3DSIO_RCP : D3DSIO_RSQ, &dst, &src, 0);
}
break;