From a4a1b4c5579f7bfeb9366d2772bcecf5d82042ee Mon Sep 17 00:00:00 2001 From: Conor McCarthy Date: Wed, 29 Nov 2023 14:38:50 +1000 Subject: [PATCH] vkd3d-shader/dxil: Set the result register data type for nop casts. Casts from minimum precision types are emitted as nop, but the result value type must be set to the cast result type. --- libs/vkd3d-shader/dxil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 0652df91..a1065c8b 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -3885,6 +3885,9 @@ static void sm6_parser_emit_cast(struct sm6_parser *sm6, const struct dxil_recor if (handler_idx == VKD3DSIH_NOP) { dst->u.reg = value->u.reg; + /* Set the result type for casts from 16-bit min precision. */ + if (type->u.width != 16) + dst->u.reg.data_type = vkd3d_data_type_from_sm6_type(type); return; }