WebGPU.rocks Logo

WebGPU/WGSL Reference

What’s on this website?

This is a quick reference for WebGPU and WGSL, the WebGPU shading language. While the WebGPU specification aims to describe the API as accurately and detailed as possible, the reference provides an easy to navigate API summary for daily use. For now, this is not a detailed introduction or programming guide.

This site is free of advertising and ad-trackers. Content is provided “as is”, with no warranty of any kind. If you find errors or want to contribute, please open an issue on Github.

What is WebGPU?

WebGPU is a future web standard and JavaScript API for interfacing with the GPU, the graphics processing unit. It is based on concepts of other modern graphics APIs such as Vulkan, Metal, and Direct3D 12. The specification is under development.

Getting started

Let’s say you want to create a GPUDevice object.

  • Select GPUDevice from the list of interfaces on the left.
  • The first line(s) show you where to look for creating a GPUDevice. You see immediately that GPUAdapter provides a .requestDevice() method.
  • Click on any method name to expand all information you need in order to prepare the arguments for calling this method.
  • Click on any type name to get detailed information about it.

Are these pages up to date?

The WebGPU specification is still under development and changes frequently. The reference pages are auto-generated regularly from the evolving WebGPU specification. If you find them outdated, open an issue or drop me a message.