WebGPU shaders are written in WGSL, the WebGPU Shading Language, which the working group publishes as a separate specification on the same track: First Public Working Draft on 18 May 2021, Candidate Recommendation Snapshot on 19 December 2024, and a Candidate Recommendation Draft since, the latest dated 21 September 2026.
The group could have accepted SPIR-V, Vulkan's binary shader format, or WHLSL, Apple's HLSL-based proposal. It chose a new text language whose every rule the browser can validate before a driver sees it, which matters for security (GPU Sandbox). Chrome 1 enforces the choice: its chrome://gpu page lists the Dawn 1,149 toggle disallow_spirv, "so that only WGSL is used for shader modules". The syntax borrows from Rust, and new capabilities arrive as language extensions you can test for, much as WebGL pages test for extensions (Checking Extensions). The set Chrome 154 reports on this book's machine:
<script>
const names = [...navigator.gpu.wgslLanguageFeatures].sort();
console.log(`${names.length} WGSL language extensions:`);
for (let i = 0; i < names.length; i += 2) {
console.log(' ' + names.slice(i, i + 2).join(', '));
}
</script>13 WGSL language extensions: buffer_view, immediate_address_space linear_indexing, packed_4x8_integer_dot_product pointer_composite_access, readonly_and_readwrite_storage_textures subgroup_id, subgroup_uniformity swizzle_assignment, texture_and_sampler_let texture_formats_tier1, uniform_buffer_standard_layout unrestricted_pointer_parameters
WGSL Types to Bindings and Diagnostics teach the language, and Migrating GLSL Shaders to WGSL maps GLSL constructs onto it.