webgpu-wgsl-uniformity
Installation
SKILL.md
WGSL Uniformity and Directives
Keep WGSL shaders valid by calling derivative, sample, and barrier builtins only in uniform control flow, and gate optional features with the correct directives.
Quick Reference
WGSL is the shading language of WebGPU 1.0-stable: Chrome 113+, Safari 26+, Firefox 141+.
Uniform control flow means code reached by all invocations in a group taking the same path. Non-uniform (divergent) control flow means the path depends on a per-invocation value. The uniformity analysis runs at shader-creation time and proves, or fails to prove, that a restricted builtin is reached uniformly.
Builtins that ALWAYS require uniform control flow: