[PATCH vkd3d v3 7/8] vkd3d-shader/hlsl: Write SM4 greater-or-equal instructions.
Matteo Bruni
mbruni at codeweavers.com
Wed Jan 19 05:52:05 CST 2022
From: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
v3: Get rid of the '\n's at the end, fix up an hlsl_fixme() message,
use UGE for HLSL_TYPE_BOOL.
libs/vkd3d-shader/hlsl_sm4.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
index cbdd5fa4..8fc4e738 100644
--- a/libs/vkd3d-shader/hlsl_sm4.c
+++ b/libs/vkd3d-shader/hlsl_sm4.c
@@ -1568,6 +1568,33 @@ static void write_sm4_expr(struct hlsl_ctx *ctx,
break;
}
+ case HLSL_OP2_GEQUAL:
+ {
+ const struct hlsl_type *src_type = arg1->data_type;
+
+ switch (src_type->base_type)
+ {
+ case HLSL_TYPE_FLOAT:
+ write_sm4_binary_op(buffer, VKD3D_SM4_OP_GE, &expr->node, arg1, arg2);
+ break;
+
+ case HLSL_TYPE_INT:
+ write_sm4_binary_op(buffer, VKD3D_SM4_OP_IGE, &expr->node, arg1, arg2);
+ break;
+
+ case HLSL_TYPE_BOOL:
+ case HLSL_TYPE_UINT:
+ write_sm4_binary_op(buffer, VKD3D_SM4_OP_UGE, &expr->node, arg1, arg2);
+ break;
+
+ default:
+ hlsl_fixme(ctx, &expr->node.loc, "SM4 greater-than-or-equal between \"%s\" operands.",
+ debug_hlsl_type(ctx, src_type));
+ break;
+ }
+ break;
+ }
+
default:
hlsl_fixme(ctx, &expr->node.loc, "SM4 bool \"%s\" expression.", debug_hlsl_expr_op(expr->op));
break;
--
2.34.1
More information about the wine-devel
mailing list