v152 · webgpu · compute

Workgroup validation

This demo uses real WebGPU feature detection and WGSL strings from the proposal. If WebGPU or subgroup-size-control is unavailable, it reports the fallback branch instead of pretending the feature ran.

Validate before creating a compute pipeline

The starting values are valid: 32 is a power of two and divides 96.

code path

if (!adapter.features.has("subgroup-size-control")) return fallback;
const device = await adapter.requestDevice({ requiredFeatures: ["subgroup-size-control"] });
await device.createComputePipelineAsync({ compute: { module, entryPoint: "main" } });

see also