nir/opt_uniform_subgroup: Handle vote_feq
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Brings the vertex shader in
dEQP-VK.subgroups.vote.framebuffer.subgroupallequal_dvec4_vertex
from 234 to 169 instructions on NAK.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35778>
This commit is contained in:
Mel Henning 2025-06-27 13:56:02 -04:00 committed by Marge Bot
parent 70fccc59fc
commit 8795006994

View file

@ -31,6 +31,7 @@ opt_uniform_subgroup_filter(const nir_instr *instr, const void *_state)
case nir_intrinsic_masked_swizzle_amd:
case nir_intrinsic_vote_all:
case nir_intrinsic_vote_any:
case nir_intrinsic_vote_feq:
case nir_intrinsic_vote_ieq:
return !nir_src_is_divergent(&intrin->src[0]);
@ -143,6 +144,9 @@ opt_uniform_subgroup_instr(nir_builder *b, nir_instr *instr, void *_state)
intrin->src[0].ssa);
}
}
} else if (intrin->intrinsic == nir_intrinsic_vote_feq) {
nir_def *x = intrin->src[0].ssa;
return nir_feq(b, x, x);
} else if (intrin->intrinsic == nir_intrinsic_vote_ieq) {
return nir_imm_true(b);
}