From a90b74baaa94b3e38e2af670fd183458633481de Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 12 May 2025 15:17:45 +0200 Subject: [PATCH] vkd3d-shader/dxil: Validate that floating-point truncation casts decrease bit width. Similarly to the integer case. --- libs/vkd3d-shader/dxil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 592754ea1..ca150831d 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -6877,7 +6877,7 @@ static enum vkd3d_shader_opcode sm6_map_cast_op(uint64_t code, const struct sm6_ case CAST_FPTRUNC: /* TODO: native 16-bit */ op = (from->u.width == 64) ? VKD3DSIH_DTOF : VKD3DSIH_NOP; - is_valid = from_fp && to_fp; + is_valid = from_fp && to_fp && to->u.width <= from->u.width; break; case CAST_FPEXT: /* TODO: native 16-bit */