A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.
npm install typegpuTypeGPU is a modular and open-ended toolkit for WebGPU, with advanced type
inference and the ability to write shaders in TypeScript.
``ts
const neighborhood = (a: number, r: number) => {
'use gpu';
return d.vec2f(a - r, a + r);
};
//
// #1) Can be called in JS
//
const range = neighborhood(1.1, 0.5);
// ^? d.v2f
//
// #2) Used to generate WGSL
//
const main = () => {
'use gpu';
return neighborhood(1.1, 0.5);
};
const wgsl = tgpu.resolve([main]);
// ^? string
//
// #3) Executed on the GPU (generates WGSL underneath)
//
root['~unstable']
.createGuardedComputePipeline(main)
.dispatchThreads();
``
We created a set of guides and tutorials to get you up and running fast. Check
out our Official Docs!
- Join the Software Mansion Community Discord
to chat about TypeGPU or other Software Mansion libraries.

Since 2012 Software Mansion is a software agency with
experience in building web and mobile apps. We are Core React Native
Contributors and experts in dealing with all kinds of React Native issues. We
can help you build your next dream product –
Hire us.