TypeGPU
TypeScript library that enhances the WebGPU API with type-safe, declarative resource management.
Overview
TypeGPU is a TypeScript library that enhances the WebGPU API with type-safe, declarative resource management. It eliminates the need to work directly with raw byte buffers by automatically handling data alignment and padding, while providing compile-time validation of GPU resources and shader bindings.
The library supports complex data types like structs and arrays with automatic TypeScript validation, and works across platforms including React Native via react-native-webgpu. TypeGPU's roadmap includes typed pipelines, imperative shader code in TypeScript, and a linker to eliminate duplication between JavaScript and GPU object definitions.
Key features
- Type-safe resource management
- Automatic byte alignment and padding
- Named bind groups with type validation
- Support for complex data types (structs, arrays)
- React Native compatibility
- WGSL shader integration
- Declarative API
- Eliminates manual byte buffer management
- Compile-time validation of GPU resources
- Automatic TypeScript validation of data
- Works on React Native
- Reduces duplication between JS and GPU code
- Still in early development (v0.6)
- Some planned features not yet released (typed pipelines, imperative code)
- Requires WebGPU support
Best for
Alternatives
More Library
Compare allData-fetching and state management library designed to handle server state in web applications.
Zero-dependency module loading environment variables from .env files into Node.js apps.
JavaScript library designed for building user interfaces with a focus on declarative syntax and efficiency.