[PATCH vkd3d v5 1/7] vkd3d-shader/hlsl: Do not allow NaNs in SM1.

Giovanni Mascellani gmascellani at codeweavers.com
Wed Apr 27 03:56:20 CDT 2022


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>
---
 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




More information about the wine-devel mailing list