Giovanni Mascellani : vkd3d-shader/hlsl: Do not allow NaNs in SM1.
Alexandre Julliard
julliard at winehq.org
Wed Apr 27 16:12:02 CDT 2022
Module: vkd3d
Branch: master
Commit: 4d181bc622a832e07fe768d248e35905d682e2d0
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=4d181bc622a832e07fe768d248e35905d682e2d0
Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date: Wed Apr 27 10:56:20 2022 +0200
vkd3d-shader/hlsl: Do not allow NaNs in SM1.
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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;
More information about the wine-cvs
mailing list