From af5e5fe31bab93bde0bceb8eecd6ea3ed7f998d6 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 13 May 2025 10:03:58 +0200 Subject: [PATCH] vkd3d-shader/dxil: Generate specialized values in sm6_parser_emit_cast() for trivial casts. There is currently no need to make a special case for 16-bit values, since the SPIR-V backend currently confuses them with 32-bit values. The generated VSIR code is not correct, but that will have to be handled at a different level. --- libs/vkd3d-shader/dxil.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index ff56cd628..315874d49 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -6949,10 +6949,9 @@ static void sm6_parser_emit_cast(struct sm6_parser *sm6, const struct dxil_recor if (handler_idx == VKD3DSIH_NOP) { - sm6_register_from_value(&dst->reg, value, sm6); - /* Set the result type for casts from 16-bit min precision. */ - if (type->u.width != 16) - dst->reg.data_type = vkd3d_data_type_from_sm6_type(type); + *dst = *value; + dst->type = type; + sm6_register_from_value(&dst->reg, dst, sm6); return; }