typegpu

Installation
SKILL.md

TypeGPU

A single schema (d.*) defines a GPU type, CPU buffer layout, and TypeScript type at once - no manual alignment, type mapping, or casting. The build plugin unplugin-typegpu transforms 'use gpu'-marked TypeScript for runtime WGSL transpilation, enabling type inference and polymorphism across the CPU/GPU boundary.

This skill targets TypeGPU 0.11.2. If the user's project is on an older release, verify API availability before relying on examples or recommended patterns here.


When to read reference files

Read before writing virtually any shader or GPU function — these two cover the rules that trip people up most:

  • references/types.md — abstract type resolution, exactly when d.f32() is required vs redundant, sampler/texture schemas for tgpu.fn signatures, CPU-side TgpuBuffer/TgpuTexture TypeScript types. If you skip this, you'll hit type errors.
  • references/shaders.md — full std library listing, loops (std.range, tgpu.unroll), tgpu.comptime, outer-scope capture rules, complete builtin reference for all three shader stages, console.log. Read this for any non-trivial shader logic.
Related skills

More from software-mansion-labs/skills

Installs
167
GitHub Stars
173
First Seen
Apr 21, 2026