vkd3d-shader/hlsl: Write SM4 saturate instructions.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-09-15 17:43:32 -05:00 committed by Alexandre Julliard
parent f0955c164a
commit 155812b124
2 changed files with 6 additions and 1 deletions

View File

@ -296,7 +296,6 @@ XFAIL_TESTS = \
tests/hlsl-vector-indexing-uniform.shader_test \
tests/math.shader_test \
tests/max.shader_test \
tests/saturate.shader_test \
tests/trigonometry.shader_test \
tests/writemask-assignop-1.shader_test
endif

View File

@ -1023,6 +1023,12 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
write_sm4_unary_op(buffer, VKD3D_SM4_OP_MOV, &expr->node, arg1, VKD3D_SM4_REGISTER_MODIFIER_NEGATE);
break;
case HLSL_OP1_SAT:
write_sm4_unary_op(buffer, VKD3D_SM4_OP_MOV
| (VKD3D_SM4_INSTRUCTION_FLAG_SATURATE << VKD3D_SM4_INSTRUCTION_FLAGS_SHIFT),
&expr->node, arg1, 0);
break;
case HLSL_OP2_ADD:
write_sm4_binary_op(buffer, VKD3D_SM4_OP_ADD, &expr->node, arg1, arg2);
break;