Getting Started
Installing locally
Install TypeGPU using the package manager of your choice.
npm install typegpu
pnpm add typegpu
yarn add typegpu
You can then import it in JavaScript/TypeScript code.
import tgpu from 'typegpu';
// ...
Live Examples
Our live examples showcase many use-cases of TypeGPU. Feel free to edit the code and see the preview update live!
StackBlitz
You can play with TypeGPU right in the browser using our StackBlitz example.
Troubleshooting
WebGPU types are not available
If WebGPU types, such as GPUDevice
or GPUBuffer
, are not recognized in your project, make sure to install the
officially maintained @webgpu/types npm package.
npm install --save-dev @webgpu/types
pnpm add -D @webgpu/types
yarn add -D @webgpu/types
Then in tsconfig.json
:
{ // ... "compilerOptions": { // ... "types": ["@webgpu/types"] }}
Or you can use typeRoots
:
{ "compilerOptions": { "typeRoots": ["./node_modules/@webgpu/types", "./node_modules/@types"] }}
If you encounter any other issues, make sure to look into the rest of our docs, as well as the WebGPU or the react-native-wgpu documentations. For any further questions, you can contact us via the Software Mansion Community Discord or on GitHub.