v148 · WebGPU · demo

Index Visualizer

Configure a dispatch grid and see exactly how global_invocation_id (3D) maps to global_invocation_index (flat). Click any cell to inspect its coordinates.

Checking linear_indexing support…
4
3
Click a cell to inspect it
Click a cell above to see its index values.

How global_invocation_index is computed

// For a dispatch with workgroup_size(W, H) and (gW, gH) groups:
// Total width  = W × gW,  Total height = H × gH

global_invocation_index =
    global_invocation_id.x
  + global_invocation_id.y × total_width
  + global_invocation_id.z × total_width × total_height

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗