---
title: "subgroupAny: shader function examples, uses and input limits"
description: "A vote gives every lane true when at least one lane's bool is true. Use it to keep work alive while any lane still needs it."
url: https://typeshade.dev/reference/functions/subgroupAny/
language: en
---

# `subgroupAny`

Function

A vote gives every lane true when at least one lane's bool is true.

## Compare examples

The fixture has three true lanes, so the vote is true. On one lane the vote is the lane's own bool.

**Model assumptions**`subgroup of 4 lanes; x = [3, 1, 4, 1]; p = [true, false, true, true]`

**Example 1`subgroupAny(p)`**

**Result**

`true in every lane`

**Example 2`subgroupAny(p)`**

**Result**

`one lane (WebGL2, CPU oracle): p`

The examples are calculation models and do not run GPU work. The reference below gives the complete call signatures. Decimal results are rounded for display. The stated assumptions determine each example; actual shader results follow the target precision and execution rules.

## When to use it

Use it to keep work alive while any lane still needs it.

## Inputs and limits

Every lane must reach the call together. The right side of `subgroupElect`() && `subgroupAny`(p) is reached by one lane and is refused.

For shader input rules and precision, consult [WGSL](https://www.w3.org/TR/WGSL/) and [GLSL ES 3.00](https://registry.khronos.org/OpenGL/specs/es/3.0/GLSL_ES_Specification_3.00.pdf).

## Related functions

- [`subgroupAdd`](https://typeshade.dev/reference/functions/subgroupAdd/)
- [`subgroupElect`](https://typeshade.dev/reference/functions/subgroupElect/)
- [`subgroupBallot`](https://typeshade.dev/reference/functions/subgroupBallot/)
- [`subgroupBroadcast`](https://typeshade.dev/reference/functions/subgroupBroadcast/)

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

Returns true when `e` is true in any lane of the subgroup.

## Syntax

```ts
declare function subgroupAny(a0: bool): bool
```

## Parameters

A parameter named by position (`a0`, `a1`) carries a name the ambient file generates. A call passes its arguments in order and names none of them.

- `a0` `bool`

## Return value

`bool`

## Description

On the CPU oracle and on WebGL2 a subgroup is one invocation ([Rule 11.21](https://typeshade.dev/reference/rules/11-21/)), so it gives the lane's own value.

## Targets

**WGSL**

`subgroupAny(a)`

**GLSL ES 3.00**

`subgroupAny` is lowered to one lane before the GLSL writer runs (Rule 11.21)

## See also

- [Functions](https://typeshade.dev/reference/functions/)
- [Builtin table](https://typeshade.dev/guide/language/builtins/#subgroups)
