typegpu

Unify CPU and GPU schemas with TypeScript for WebGPU applications.

265|12|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/software-mansion-labs/skills --skill typegpu-software-mansion-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typegpu
Source: https://github.com/software-mansion-labs/skills/tree/main/skills/typegpu
Command: npx skills add https://github.com/software-mansion-labs/skills --skill typegpu-software-mansion-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TypeGPU provides a single, strongly-typed schema system to unify CPU and GPU data for WebGPU development, preventing mismatches between host data structures and GPU shader interfaces.

Core Features & Use Cases

  • Type-safe d.* schemas for buffers, textures, and shader interfaces that span CPU and GPU boundaries.
  • Automatic WGSL generation from 'use gpu' functions and support for library features like tgpu.fn, shader entrypoints, and the std library.
  • Real-world scenarios include compute pipelines for simulations, render pipelines with fixed resources, and model loading with compact vertex formats and AoS/AoS conversions.

Quick Start

Install TypeGPU, import tgpu and d from 'typegpu', and write a minimal 'use gpu' function to generate a WGSL kernel.

Frequently Asked Questions about typegpu

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent type mismatches between CPU buffers and GPU shaders in WebGPU?

Type-safe WebGPU development requires a single schema system that unifies CPU and GPU data structures, preventing mismatches between host buffers and shader interfaces. This approach enforces strict typed APIs for buffers and pipelines.

Can I generate WGSL code automatically from TypeScript functions?

Yes, generating WGSL automatically from TypeScript functions is possible using the 'use gpu' directive. This translates TypeScript logic into WGSL kernels, supporting shader entrypoints and standard library functions.

What is the best way to manage type-safe compute and render pipelines in TypeScript?

Managing type-safe compute and render pipelines in TypeScript is best achieved by applying a unified schema to define buffers and textures, enforcing strict typed APIs across CPU and GPU boundaries for real-time graphics and simulations.

How do I set up a minimal WebGPU compute pipeline using TypeScript schemas?

To set up a minimal WebGPU compute pipeline, install the library, import the schema modules, and write a 'use gpu' function to generate a WGSL kernel. This enforces strict typed APIs for buffers and pipelines.

Does TypeGPU support loading 3D models with compact vertex formats?

Yes, TypeGPU supports 3D model loading with compact vertex formats, including Array of Structures to Structure of Arrays conversions, optimizing WebGPU buffer management for complex graphics workflows.