subgroupAny
Performs a subgroup/wave ANY vote over a boolean predicate: returns true if the predicate is true for any active invocation in the subgroup. Implemented as an intent-style, zero-argument method attached to a boolean node, used as `boolExpr.subgroupAny()`.
Core Advantages
Fast, consistent boolean reduction within a GPU subgroup without shared memory or explicit loops, enabling early-out/branch gating and reduced divergence (subject to backend subgroup support).
Common Uses
Early-out/masking: if any lane needs an expensive path, let the whole wave take that branch together.
Edge/event aggregation: highlight or tag when any lane in the wave detects a feature.
Visibility/expense gating: compute costly terms only when at least one lane requires them.
How to adjust
No parameters. Call `.subgroupAny()` on the boolean predicate you want to vote on. Requires subgroup/wave support in the graphics backend (e.g., WebGPU/WGSL); on unsupported platforms subgroup intrinsics may be unavailable or downgraded.
Code Examples
1/* Subgroup ANY vote over a "too bright" predicate */
2const luma = dot( baseColor.rgb, vec3( 0.2126, 0.7152, 0.0722 ) );
3const isOverBright = luma.greaterThan( 1.0 );
4
5/* Intent-style zero-arg call on the boolean expression */
6const anyOverBright = isOverBright.subgroupAny();
7
8/* If any lane is too bright, add a subtle glow for the whole wave */
9material.emissiveNode = anyOverBright.cond( vec3( 1, 1, 0 ).mul( 0.2 ), vec3( 0 ) );