kk: Fix emitting negative infinity

Fixes subgroup max tests, which use -INFINITY as a base when
calculating the reference maximum value.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41186>
This commit is contained in:
squidbus 2026-04-26 18:37:13 -07:00 committed by Marge Bot
parent 0bc87e47e2
commit 2cd9dd1fd7

View file

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