From 361ecd6cf52257558ba4366f754ff34ccd82b728 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Tue, 13 May 2025 11:17:06 +0200 Subject: [PATCH] vkd3d-shader/dxil: Rewrite sm6_value_is_undef() in terms of the value type. --- libs/vkd3d-shader/dxil.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index a81fc4588..cdb032969 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2307,7 +2307,15 @@ static bool sm6_value_is_constant_zero(const struct sm6_value *value) static inline bool sm6_value_is_undef(const struct sm6_value *value) { - return sm6_value_is_register(value) && value->reg.type == VKD3DSPR_UNDEF; + switch (value->value_type) + { + case VALUE_TYPE_UNDEFINED: + case VALUE_TYPE_INVALID: + return true; + + default: + return false; + } } static bool sm6_value_vector_is_constant_or_undef(const struct sm6_value **values, unsigned int count)