diff --git a/src/kosmickrisp/compiler/msl_type_inference.c b/src/kosmickrisp/compiler/msl_type_inference.c index 30e3b472785..449ec61a62a 100644 --- a/src/kosmickrisp/compiler/msl_type_inference.c +++ b/src/kosmickrisp/compiler/msl_type_inference.c @@ -746,8 +746,10 @@ emit_src_component(struct nir_to_msl_ctx *ctx, nir_src *src, unsigned comp) switch (type) { case TYPE_FLOAT: { double v = nir_src_comp_as_float(*src, comp); - if (isinf(v)) { + if (v == INFINITY) { P(ctx, "(INFINITY"); + } else if (v == -INFINITY) { + P(ctx, "(-INFINITY"); } else if (isnan(v)) { P(ctx, "(NAN"); } else {