# TypeGPU > Type-safe WebGPU toolkit TypeGPU 0.12.11 is a TypeScript toolkit for WebGPU. Its API is newer than most models' training data. - In a project with TypeGPU installed, read node_modules/typegpu/skills/typegpu/SKILL.md first. It matches the installed version, and the .d.ts files in node_modules/typegpu are the exact API. - The pages below are Markdown. The HTML version of each is at the same URL without .md. In 'use gpu' functions: - Vectors, matrices, structs and arrays are references. Copy them (d.vec3f(v)) before assigning to a let, or use const. - Write d.f32(1) where a float is needed. Scalar a / b divides as floats; use std.intdiv for integers. Shift u32 right with >>>. - Use `std.*` math, not `Math.*`. - Write GPU methods as properties (step: () => { 'use gpu'; ... }), not shorthand methods. - Values captured from the outer scope are baked in as constants. Use uniforms for anything that changes. ## Start here - [Why TypeGPU?](https://docs.swmansion.com/TypeGPU/why-typegpu.md): What TypeGPU is, how it compares to frameworks like Three.js, and the design principles behind it. - [Getting Started](https://docs.swmansion.com/TypeGPU/getting-started.md): A guide on how to start using the TypeGPU library. ## Fundamentals - [Your first GPU program](https://docs.swmansion.com/TypeGPU/fundamentals/your-first-gpu-program.md): Create and call a small TypeGPU compute shader, then store and read its result. - [Going parallel with reusable resources](https://docs.swmansion.com/TypeGPU/fundamentals/compute-shaders.md): Creating and calling non-trivial compute shaders in TypeGPU and managing reusable resources with bind groups. - [Vertices and fragments](https://docs.swmansion.com/TypeGPU/fundamentals/vertices-and-fragments.md): Draw simple shapes with render pipelines in TypeGPU. ## APIs - [Roots](https://docs.swmansion.com/TypeGPU/apis/roots.md): A guide on how to create and use the Root API - [Functions](https://docs.swmansion.com/TypeGPU/apis/functions.md): A guide on how to create and use the TypeGPU typed functions. - [Pipelines](https://docs.swmansion.com/TypeGPU/apis/pipelines.md): A guide on how to use TypeGPU render and compute pipelines. - [Buffers](https://docs.swmansion.com/TypeGPU/apis/buffers.md): A guide on how to use TypeGPU typed buffers. - [Textures](https://docs.swmansion.com/TypeGPU/apis/textures.md): A guide on how to use TypeGPU typed textures. - [Variables](https://docs.swmansion.com/TypeGPU/apis/variables.md): A guide on how to create and use the TypeGPU typed variables. - [Data Schemas](https://docs.swmansion.com/TypeGPU/apis/data-schemas.md): How TypeGPU data schemas such as d.u32, d.vec3f, d.struct and d.arrayOf describe GPU types, memory layout and TypeScript types at once. - [Bind Groups](https://docs.swmansion.com/TypeGPU/apis/bind-groups.md): A guide on how to define typed bind group layouts and create bind groups for TypeGPU resources. - [Resolve](https://docs.swmansion.com/TypeGPU/apis/resolve.md): Resolve API can be used to extend shader code with WGSL definitions of TypeGPU-defined objects. - [Vertex Layouts](https://docs.swmansion.com/TypeGPU/apis/vertex-layouts.md): A guide on how to create and use typed vertex layouts - [Slots](https://docs.swmansion.com/TypeGPU/apis/slots.md): Slots can be used to inject arbitrary values into shader code at a granular level. - [Accessors](https://docs.swmansion.com/TypeGPU/apis/accessors.md): Accessors are schema-aware typed placeholders for GPU resources, allowing reusable GPU functions to reference buffers, variables, textures, and more without coupling to a specific resource. - [Utilities](https://docs.swmansion.com/TypeGPU/apis/utils.md): A list of various utilities provided by TypeGPU. ## Advanced - [Enabling Features](https://docs.swmansion.com/TypeGPU/advanced/enabling-features.md): How to declare and activate WebGPU device features in TypeGPU. - [Timing Your Pipelines](https://docs.swmansion.com/TypeGPU/advanced/timestamp-queries.md): How to use timestamp queries to measure the performance of your pipelines. - [Minifying & Obfuscating Shaders](https://docs.swmansion.com/TypeGPU/advanced/minifying-shaders.md): How to setup TypeGPU so that resulting shaders will be smaller or obfuscated. ## Integration - [WebGPU Interoperability](https://docs.swmansion.com/TypeGPU/integration/webgpu-interoperability.md): How to adopt TypeGPU incrementally in a WebGPU codebase and unwrap TypeGPU resources to raw WebGPU objects. - [React Native](https://docs.swmansion.com/TypeGPU/integration/react-native.md): A guide on how to use TypeGPU in React Native applications. - [React Native Worklets](https://docs.swmansion.com/TypeGPU/integration/react-native/worklets.md): A guide on running TypeGPU render loops on the UI thread with react-native-worklets. - [WESL Interoperability](https://docs.swmansion.com/TypeGPU/integration/wesl-interoperability.md): Planned integration between TypeGPU and WESL, a community standard for enhanced WGSL. In development. - [Working with wgpu-matrix](https://docs.swmansion.com/TypeGPU/integration/working-with-wgpu-matrix.md): A guide on how to use TypeGPU with wgpu-matrix. ## Ecosystem - [@typegpu/noise](https://docs.swmansion.com/TypeGPU/ecosystem/typegpu-noise.md): Pseudo-random number generation, random distributions and Perlin noise for TypeGPU and WebGPU shaders. - [@typegpu/three](https://docs.swmansion.com/TypeGPU/ecosystem/typegpu-three.md): Writing Three.js TSL nodes as TypeGPU functions with the @typegpu/three package. - [@typegpu/react](https://docs.swmansion.com/TypeGPU/ecosystem/typegpu-react.md): React and React Native hooks for creating TypeGPU roots, resources and frame loops. - [@typegpu/gl](https://docs.swmansion.com/TypeGPU/ecosystem/typegpu-gl.md): GLSL generation for TypeGPU functions and an experimental WebGL 2 backend for a subset of the render API. - [@typegpu/sdf](https://docs.swmansion.com/TypeGPU/ecosystem/typegpu-sdf.md): 2D and 3D signed distance functions and operators for ray marching, masking and anti-aliased shapes. - [@typegpu/radiance-cascades](https://docs.swmansion.com/TypeGPU/ecosystem/typegpu-radiance-cascades.md): 2D global illumination: describe a scene with GPU functions and get a texture with the light reaching every pixel. ## Tooling - [TypeGPU CLI](https://docs.swmansion.com/TypeGPU/tooling/typegpu-cli.md): Create a TypeGPU project or add TypeGPU to an existing project with npx typegpu@latest. - [Build Plugin](https://docs.swmansion.com/TypeGPU/tooling/unplugin-typegpu.md): A guide on how to use the optional build plugin for TypeGPU - [Lint Plugin](https://docs.swmansion.com/TypeGPU/tooling/eslint-plugin-typegpu.md): A guide on how to use the optional lint plugin for TypeGPU - [AI Tools](https://docs.swmansion.com/TypeGPU/tooling/ai-tools.md): A guide to using TypeGPU resources with AI coding agents. - [WGSL to TypeGPU](https://docs.swmansion.com/TypeGPU/tooling/tgpu-gen.md): Convert existing WGSL shader files into TypeGPU definitions with tgpu-gen. ## Migrations - [Migrating to 0.12](https://docs.swmansion.com/TypeGPU/migrations/0-12.md): Changes required when upgrading to TypeGPU 0.12, including removed APIs and companion package changes. - [Migrating to 0.11](https://docs.swmansion.com/TypeGPU/migrations/0-11.md): Changes required when upgrading to TypeGPU 0.11. ## About - [Software Mansion](https://swmansion.com): maintainer of TypeGPU