Software Mansion Logo
TypeGPU Logo

TypeScript library that enhances the WebGPU API, allowing resource management in a type-safe, declarative way.

Get to know TypeGPU

Discover how it can change the way you work with GPU rendering and computing.

task-check

Easily encode and decode

Leveraging typed-binary ensures you don't have to think about bytes when writing your GPU programs ever again.

grid-mixed

Compose data types

Complex data types like structs and arrays can be easily described, and TypeScript automatically validates outgoing and incoming data.

atom

Run it on React Native

Works on React Native thanks to the recently announced react-native-wgpu library.

More coming soon...

Roadmap

The road to end-to-end type safety on the GPU involves implementing several interoperating primitives. Below is our roadmap of features that aim to fulfill that goal.

  1. Data structures & buffers v0.1

    The WebGPU Shading Language (WGSL) gives developers a rich sense of the structure of the data that it operates on. This is lost when accessed through JavaScript, as the APIs accept raw byte buffers. TypeGPU regains that information on the JavaScript side and handles proper byte alignment and padding automatically.

  2. Bind groups v0.2

    Connecting resources to shaders via numeric indices can lead to problems that are hard to catch at build-time/CI. By using named keys and typed data structures we can ensure that the provided resources are what the shader expects.

  3. Functions

    By wrapping each function with a "typed shell", they can be moved across different files/modules. Any resources (variables, buffers, etc.) in the external scope can be accessed inside the function.

  4. Pipelines

    To ensure that shader stages match each other, and pipeline constants are filled with proper values, TypeGPU plans to provide typed pipelines.

  5. Imperative code

    By giving developers the ability to write imperative shader code in TypeScript, we can leverage the excellent TypeScript LSP to complete the type safety puzzle, bridging the gap between our API and type-safe shader code.

Got hooked?

Try TypeGPU and reshape your GPU rendering and computing.

Get started