From 7c0da1747a89a8cea27a42ace51b318e9d843a19 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Thu, 12 Jun 2025 19:22:07 +0200 Subject: [PATCH] vkd3d-shader/dxil: Allow constant zero values to be floating point. This fixes commit 59fb3a789384dab1db4d779338c03a121debb5e6, where the floating point alternative was mistakenly ignored. --- libs/vkd3d-shader/dxil.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 53578ce71..1c7ed0d9e 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2271,9 +2271,19 @@ static inline bool sm6_value_is_constant(const struct sm6_value *value) static bool sm6_value_is_constant_zero(const struct sm6_value *value) { - if (value->value_type != VALUE_TYPE_CONSTANT || value->type->class != TYPE_CLASS_INTEGER) + if (value->value_type != VALUE_TYPE_CONSTANT) return false; + switch (value->type->class) + { + case TYPE_CLASS_INTEGER: + case TYPE_CLASS_FLOAT: + break; + + default: + return false; + } + if (value->type->u.width == 64) return value->u.constant.immconst.immconst_u64[0] == 0; else