This class represents a set of built in WGSL shader functions that sync synchronously execute an operation across a subgroup, or ‘warp’, of compute or fragment shader invocations within a workgroup. Typically, these functions will synchronously execute an operation using data from all active invocations within the subgroup, then broadcast that result to all active invocations. In other graphics APIs, subgroup functions are also referred to as wave intrinsics (DirectX/HLSL) or warp intrinsics (CUDA).
Constructor
new SubgroupFunctionNode(method, aNode?, bNode?)| Parameter | Type | Default Value |
|---|---|---|
| method | string | — |
| aNode? | Node | null |
| bNode? | Node | null |
Constructs a new function node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| method | string | — | |
| aNode | Node | — | |
| bNode | Node | — | |
| Method | Type | |
|---|---|---|
| getInputType | (builder: any) => any | |
| generateNodeType | (builder: any) => any | |
| generate | (builder: any, output: any) => any | |
| serialize | (data: any) => void | |
| deserialize | (data: any) => void | |
Extends
TempNodeReturns true if this invocation has the lowest subgroup_invocation_id among active invocations in the subgroup.
Returns
boolReturns a set of bitfields where the bit corresponding to subgroup_invocation_id is 1 if pred is true for that active invocation and 0 otherwise.
| Parameter | Type | Default Value |
|---|---|---|
| pred | bool | — |
Returns
vec4<u32>A reduction that adds e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn inclusive scan returning the sum of e for all active invocations with subgroup_invocation_id less than or equal to this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn exclusive scan that returns the sum of e for all active invocations with subgroup_invocation_id less than this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that multiplies e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn inclusive scan returning the product of e for all active invocations with subgroup_invocation_id less than or equal to this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberAn exclusive scan that returns the product of e for all active invocations with subgroup_invocation_id less than this invocation.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a bitwise and of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a bitwise or of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a bitwise xor of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a min of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberA reduction that performs a max of e among all active invocations and returns that result.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberReturns true if e is true for all active invocations in the subgroup.
Returns
boolReturns true if e is true for any active invocation in the subgroup
Returns
boolBroadcasts e from the active invocation with the lowest subgroup_invocation_id in the subgroup to all other active invocations.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
| id | number | — |
Returns
numberSwaps e between invocations in the quad in the X direction.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberSwaps e between invocations in the quad in the Y direction.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberSwaps e between invocations in the quad diagonally.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
numberBroadcasts e from the invocation whose subgroup_invocation_id matches id, to all active invocations.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
| id | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches id
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| id | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id ^ mask.
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| mask | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id - delta
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| delta | number | — |
Returns
numberReturns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id + delta
| Parameter | Type | Default Value |
|---|---|---|
| v | number | — |
| delta | number | — |
Returns
numberBroadcasts e from the quad invocation with id equal to id.
| Parameter | Type | Default Value |
|---|---|---|
| e | number | — |
Returns
number