Graphics & Compute

WebGPU

Probing…

WebGPU is a web platform capability in the Graphics & Compute category. Modern GPU API for rendering and compute shaders. Supported in Chromium 113+, Firefox 141+, and Safari 26+. Requires a secure context (HTTPS or localhost).

Secure context

Try it

Loading demo…

Code

const adapter = await navigator.gpu.requestAdapter()
const device = await adapter.requestDevice()
const ctx = canvas.getContext('webgpu')
const format = navigator.gpu.getPreferredCanvasFormat()
ctx.configure({ device, format })
const module = device.createShaderModule({ code: wgsl })
const pipeline = device.createRenderPipeline({
  layout: 'auto',
  vertex: { module, entryPoint: 'vs' },
  fragment: { module, entryPoint: 'fs', targets: [{ format }] },
})
const enc = device.createCommandEncoder()
const pass = enc.beginRenderPass({ colorAttachments: [{
  view: ctx.getCurrentTexture().createView(),
  loadOp: 'clear', storeOp: 'store',
}] })
pass.setPipeline(pipeline); pass.draw(3); pass.end()
device.queue.submit([enc.finish()])

Browser support

Chromium
113
Firefox
141
Safari
26

Frequently asked questions

Which browsers support WebGPU?

Supported in Chromium 113+, Firefox 141+, and Safari 26+.

Does WebGPU require HTTPS?

Yes. WebGPU needs a secure context, so it only works over HTTPS (or on localhost during development).

What is WebGPU used for?

Modern GPU API for rendering and compute shaders.

Can I try WebGPU in my browser?

Yes. shwcs.net runs a live WebGPU demo that probes your current browser and lets you try the API. Everything runs locally — nothing is sent anywhere.

MDN reference ↗ Specification ↗