Expand description
Compute shader dispatch helpers.
Provides workgroup sizing utilities, dispatch grid calculation, and basic barrier / dependency tracking for GPU compute passes.
Structs§
- Barrier
Record - A recorded pipeline barrier.
- Barrier
Tracker - Tracks barriers inserted during a compute pass.
- Data
Driven Dispatch - Computes and stores dispatch parameters that depend on the number of data elements only known at dispatch-preparation time (e.g., after a GPU readback or a CPU-side counter).
- Dispatch
Grid - A 3-D dispatch grid (number of workgroups in each dimension).
- Dispatch
Record - A recorded compute dispatch (for replay / inspection).
- Dispatch
Tracker - Tracks dispatches in a compute pass.
- Workgroup
Size - A 3-D workgroup size.
Enums§
- Barrier
Kind - Type of pipeline barrier.
- Data
Dispatch Strategy - Strategy used to derive workgroup counts from a data-dependent element count at dispatch preparation time.
Constants§
- MAX_
WORKGROUP_ DIM - Maximum recommended workgroup size per dimension on most GPUs.
Functions§
- dispatch_
1d - Calculate the dispatch grid needed to cover
countelements with threads of sizewg_sizein the X dimension. - dispatch_
2d - Calculate the dispatch grid needed to cover a
width × heightimage with a planar workgroup of size(wg_x, wg_y). - dispatch_
3d - Calculate the dispatch grid for a 3-D volume.
- recommend_
2d_ workgroup - Recommend a square workgroup size that keeps total threads ≤
max_threadsand is a power of two.