software-mansion/TypeGPU
A modular and open-ended toolkit for WebGPU, with advanced type inference and the ability to write shaders in TypeScript
What it solves
TypeGPU addresses the complexity and lack of type safety when working with WebGPU and its shading language (WGSL). It removes common hurdles like manual data serialization, complex type inference, and the difficulty of dynamically generating shaders, while preventing vendor lock-in by allowing developers to eject into vanilla WebGPU at any time.
How it works
It provides a modular toolkit that allows developers to write shaders directly in TypeScript. The system uses advanced type inference to mirror WGSL syntax within TypeScript, enabling the generation of WGSL code from TypeScript functions. It also acts as an interoperability layer, allowing different WebGPU libraries to share typed buffers and resources without needing to copy data back to the CPU.
Who it’s for
Web developers and library authors building graphics-intensive applications, games, or compute-heavy tools that require the performance of WebGPU but want the developer experience and type safety of TypeScript.
Highlights
- TypeScript Shaders: Write GPU code using TypeScript functions that can be resolved into WGSL.
- Type-Safe Interoperability: Pass typed buffers between different libraries without CPU-side memory copying.
- Zero Lock-in: Ability to granularly eject into vanilla WebGPU APIs.
- Modular Ecosystem: Includes specialized packages for color helpers, noise functions, and bundler plugins.
Related
- Project
- Project
- Project
- Project