Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
libs/vkd3d-shader/hlsl_constant_ops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_constant_ops.c b/libs/vkd3d-shader/hlsl_constant_ops.c
index 2e16577f..d8787c21 100644
--- a/libs/vkd3d-shader/hlsl_constant_ops.c
+++ b/libs/vkd3d-shader/hlsl_constant_ops.c
@@ -278,10 +278,10 @@ static bool fold_div(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst,
"Floating point division by zero.");
}
dst->value[k].f = src1->value[k].f / src2->value[k].f;
- if (ctx->profile->major_version < 4 && isinf(dst->value[k].f))
+ if (ctx->profile->major_version < 4 && !isfinite(dst->value[k].f))
{
hlsl_error(ctx, &dst->node.loc, VKD3D_SHADER_ERROR_HLSL_DIVISION_BY_ZERO,
- "Infinities are not allowed by the shader model.");
+ "Infinities and NaNs are not allowed by the shader model.");
}
break;
--
2.36.0