Both are tested against the same conformance suite and expose the same webgpu.h C API; they differ in language and packaging:
| Dawn | wgpu | |
|---|---|---|
| Language, license | C++, BSD 3-Clause | Rust, MIT or Apache-2.0 |
| Browsers and runtimes | Chrome 1 , Edge, Chromium 4,389 browsers | Firefox 555 , Servo 185,019 , Deno 60,577 |
| Shader compiler | Tint | naga |
| Cross-process layer | Dawn Wire (built in) | Browser's own IPC over wgpu-core |
| Native targets | D3D12, Vulkan, Metal, OpenGL ES | D3D12, Vulkan, Metal, OpenGL (ES), WebGL 2 |
| Releases | Rolling daily tags | Numbered majors (v30.0.1, August 2026) |
In practice, error messages differ between the two (never parse them), and a bug may exist in only one engine, so test in both Chrome and Firefox. Natively, Dawn suits C++ codebases; wgpu suits Rust and versioned releases.
<!doctype html>
<style>
body { margin: 0; background: #f7f4ee; font: 14px system-ui, sans-serif; }
.stage { position: relative; width: 100%; max-width: 600px; }
.stage canvas { display: block; width: 100%; }
.stage canvas + canvas { position: absolute; inset: 0; pointer-events: none; }
</style>
<div class="stage">
<canvas id="view" width="600" height="380"></canvas>
<canvas id="labels" width="600" height="380"></canvas>
</div>
<script>
const canvas = document.getElementById('view');
const ink = document.getElementById('labels').getContext('2d');
function showMessage(text) { // 2D fallback when WebGPU is missing
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#fbeaea'; ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = '#8a2b2b'; ctx.font = '18px system-ui, sans-serif'; ctx.textAlign = 'center';
ctx.fillText(text, canvas.width / 2, canvas.height / 2);
}
function label(text, x, y, size = 12, color = '#2b2b2b', align = 'center', weight = '') {
ink.font = `${weight} ${size}px system-ui, sans-serif`; ink.fillStyle = color; ink.textAlign = align;
ink.fillText(text, x, y);
}
const rows = [['Language, license', 'C++, BSD 3-Clause', 'Rust, MIT or Apache-2.0'],
['Browsers, runtimes', 'Chrome, Edge, Chromium', 'Firefox, Servo, Deno'],
['Shader compiler', 'Tint', 'naga'],
['Cross-process layer', 'Dawn Wire (built in)', "Browser's IPC over wgpu-core"],
['Native targets', 'D3D12, Vulkan, Metal, GL ES', 'D3D12, Vulkan, Metal, GL, WebGL 2'],
['Releases', 'Rolling daily tags', 'Numbered majors (v30.0.1)'],
['Shared by both', 'webgpu.h C API, the same conformance suite (gpuweb/cts)', null]];
const DAWN = [0.26, 0.52, 0.96], WGPU = [0.80, 0.36, 0.16];
async function main() {
const adapter = await navigator.gpu?.requestAdapter();
if (!adapter) return showMessage('WebGPU is not available in this browser');
const device = await adapter.requestDevice();
const context = canvas.getContext('webgpu');
const format = navigator.gpu.getPreferredCanvasFormat();
context.configure({ device, format });
const boxes = [[160, 12, 210, 36, ...DAWN, 10], [380, 12, 210, 36, ...WGPU, 10]];
label('Dawn', 265, 36, 15, '#fff', 'center', 'bold');
label('wgpu', 485, 36, 15, '#fff', 'center', 'bold');
rows.forEach(([topic, dawn, wgpu], i) => {
const y = 58 + i * 44;
boxes.push([10, y, 144, 36, 0.90, 0.88, 0.84, 8]);
label(topic, 82, y + 23, 12, '#333', 'center', 'bold');
if (wgpu === null) { // one cell spanning both columns
boxes.push([160, y, 430, 36, 0.86, 0.93, 0.87, 8]);
label(dawn, 375, y + 23, 12.5, '#174d2b');
} else {
boxes.push([160, y, 210, 36, 0.88, 0.92, 0.99, 8], [380, y, 210, 36, 0.99, 0.90, 0.85, 8]);
label(dawn, 265, y + 23, 12.5, '#123a7a');
label(wgpu, 485, y + 23, 12.5, '#6a2a0e');
}
});
label('Error messages differ between the two: never parse them, and test in Chrome and Firefox.', 300, 370, 12, '#444');
const module = device.createShaderModule({ code: `
struct Box { rect: vec4f, style: vec4f } // style: r, g, b, corner radius
@group(0) @binding(0) var<storage> boxes: array<Box>;
struct Out { @builtin(position) pos: vec4f, @location(0) local: vec2f,
@location(1) @interpolate(flat) i: u32 }
@vertex fn vs(@builtin(vertex_index) v: u32, @builtin(instance_index) i: u32) -> Out {
let corner = vec2f(f32(v & 1), f32(v >> 1)); // triangle-strip corners
let r = boxes[i].rect;
let px = r.xy + corner * r.zw;
return Out(vec4f(px.x / 300 - 1, 1 - px.y / 190, 0, 1), corner * r.zw, i);
}
@fragment fn fs(in: Out) -> @location(0) vec4f {
let b = boxes[in.i];
let half = b.rect.zw / 2;
let q = abs(in.local - half) - half + b.style.w; // signed distance to a rounded box
let d = length(max(q, vec2f(0))) + min(max(q.x, q.y), 0) - b.style.w;
let a = clamp(0.5 - d, 0, 1);
return vec4f(b.style.rgb * a, a); // premultiplied alpha
}` });
const blend = { srcFactor: 'one', dstFactor: 'one-minus-src-alpha' };
const pipeline = device.createRenderPipeline({ layout: 'auto',
vertex: { module }, primitive: { topology: 'triangle-strip' },
fragment: { module, targets: [{ format, blend: { color: blend, alpha: blend } }] } });
const data = new Float32Array(boxes.flat());
const buffer = device.createBuffer({ size: data.byteLength, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST });
device.queue.writeBuffer(buffer, 0, data);
const group = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), entries: [{ binding: 0, resource: { buffer } }] });
const encoder = device.createCommandEncoder();
const pass = encoder.beginRenderPass({ colorAttachments: [{ view: context.getCurrentTexture().createView(),
clearValue: [0.97, 0.96, 0.93, 1], loadOp: 'clear', storeOp: 'store' }] });
pass.setPipeline(pipeline);
pass.setBindGroup(0, group);
pass.draw(4, boxes.length);
pass.end();
device.queue.submit([encoder.finish()]);
}
main();
</script>