Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Bindings

batch_infos

#
@group(0)
@binding(0)
var<storage, read_write> batch_infos: array<BatchInfo>

prefix_sum

#
@group(0)
@binding(1)
var<storage, read_write> prefix_sum: array<u32>

dispatch_indirect_buffer

#
@group(0)
@binding(2)
var<storage, read_write> dispatch_indirect_buffer: array<DispatchIndirectArgs>

Functions

main

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(64)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1

This is invoked once per effect batch each frame, before the update pass, to recalculate the prefix sum of the alive particle counts per instance in that batch. Before this pass, the prefix sum buffer contins the number of alive particles for each instance. After it, it contains a prefix sum of that number.

fn main (
@builtin(global_invocation_id)
global_invocation_id: vec3<u32>
)
Contents