From 65d72f1392a1d2e1d2607cf66e97717780ad2f9e Mon Sep 17 00:00:00 2001 From: Iwo Plaza Date: Tue, 28 Jul 2026 11:59:17 +0200 Subject: [PATCH] docs: 0.12 changelog --- .../content/docs/blog/typegpu-0.12/index.mdx | 66 ++++++++++++++++ .../src/content/docs/migrations/0-12.mdx | 78 +++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 apps/typegpu-docs/src/content/docs/blog/typegpu-0.12/index.mdx diff --git a/apps/typegpu-docs/src/content/docs/blog/typegpu-0.12/index.mdx b/apps/typegpu-docs/src/content/docs/blog/typegpu-0.12/index.mdx new file mode 100644 index 0000000000..62a722641f --- /dev/null +++ b/apps/typegpu-docs/src/content/docs/blog/typegpu-0.12/index.mdx @@ -0,0 +1,66 @@ +--- +title: TypeGPU 0.12 +date: 2026-08-11 +tags: + - Release notes +authors: + - name: Iwo Plaza + title: TypeGPU developer + picture: https://avatars.githubusercontent.com/u/7166752?s=200 +--- + +To sort out: +- Better bitcasts +- Private property access +- Unified buffer bindings, and being able to pass usages to bind groups +- Better treeshakability + - Flattened externals + - Improved build output +- Transient attachment and raw texture espace hatch +- initSync and initAsync +- Experimental WebGL fallback + +Hello fellow GPU enthusiast! + +Over the past 2 months, my team and I have been pulling on a few threads that we thought would improve TypeGPU in terms of efficiency, and as a byproduct, we actually made the APIs more convenient. We are also introducing a _lint plugin_ to further improve the diagnostics and feedback you receive while writing TypeGPU shaders, on top of the type safety we already provide. + +- [New examples](#new-examples) +- [Migration guide](#migration-guide) +- [New and improved write APIs](#new-and-improved-write-apis) +- [Shader code ergonomics](#shader-code-ergonomics) +- [Ecosystem updates](#ecosystem-updates) +- [What's next?](#whats-next) + + +We have been pulling a few more threads than I mentioned here... but for those, you'll have to wait for the next blog post 🤐. + +## New examples + +... + +## Migration guide + +We have prepared a detailed [Migrating to 0.12](/TypeGPU/migrations/0-12) guide to ensure your app is up to date when it comes to the latest TypeGPU API updates. + +## Worklet support + +## Better debugging + +We are now displaying better errors thanks to reprinting close-to-source JS code instead of WGSL. Thanks to @aleksanderkatan for this work. + +You can now silence warnings. + +## Ecosystem + +### Better pseudo-random number generator in @typegpu/noise + +### Shaders.com + +A minimalist WebGPU framework called [Motion GPU](https://motion-gpu.dev/) introduced a way to integrate with TypeGPU, and wrote about it +in their documentation [(Integrations / TypeGPU)](https://motion-gpu.dev/docs/integrations-typegpu). It's awesome to see the continued adoption +of TypeGPU in other ecosystems and communities 🎉 + +## What's next? + +There are many more things introduced in TypeGPU 0.11 that I haven't mentioned. If you're curious, you can +read [the full 0.11.0 changelog](https://github.com/software-mansion/TypeGPU/compare/v0.10.2...v0.11.0). diff --git a/apps/typegpu-docs/src/content/docs/migrations/0-12.mdx b/apps/typegpu-docs/src/content/docs/migrations/0-12.mdx index 822d4598d7..f9ec87ee0f 100644 --- a/apps/typegpu-docs/src/content/docs/migrations/0-12.mdx +++ b/apps/typegpu-docs/src/content/docs/migrations/0-12.mdx @@ -2,3 +2,81 @@ title: Migrating to 0.12 draft: true --- + +## New pseudo-random number generator in @typegpu/noise + +Along with @typegpu/noise v0.12.0, a more robust and efficient pseudo-random number generator became the default: `Xoroshiro64**`, introduced by David Blackman and Sebastiano Vigna in ["Scrambled Linear Pseudorandom Number Generators"](https://arxiv.org/pdf/1805.01407). + +If your app depends on the previous implementation's exact behavior, you can use the following code to keep using the legacy generator: + +```ts twoslash +import { tgpu, d, std } from 'typegpu'; +import { + randf, + randomGeneratorSlot, + randomGeneratorShell, + type StatefulGenerator +} from '@typegpu/noise'; + +/** + * Incorporated from https://www.cg.tuwien.ac.at/research/publications/2023/PETER-2023-PSW/PETER-2023-PSW-.pdf + * "Particle System in WebGPU" by Benedikt Peter + */ +const BPETER11: StatefulGenerator = (() => { + const seed = tgpu.privateVar(d.vec2f); + + return { + seed: tgpu.fn([d.f32])((value) => { + seed.$ = d.vec2f(value, 0); + }), + + seed2: tgpu.fn([d.vec2f])((value) => { + seed.$ = d.vec2f(value); + }), + + seed3: tgpu.fn([d.vec3f])((value) => { + 'use gpu'; + seed.$ = value.xy + d.vec2f(value.z); + }), + + seed4: tgpu.fn([d.vec4f])((value) => { + 'use gpu'; + seed.$ = value.xy + value.zw; + }), + + sample: randomGeneratorShell(() => { + 'use gpu'; + const a = std.dot(seed.$, d.vec2f(23.14077926, 232.61690225)); + const b = std.dot(seed.$, d.vec2f(54.47856553, 345.84153136)); + seed.$.x = std.fract(std.cos(a) * 136.8168); + seed.$.y = std.fract(std.cos(b) * 534.7645); + return seed.$.y; + }).$name('sample'), + }; +})(); + +// You can then use the BPETER11 generator by providing it to roots or functions + +const root = await tgpu.init(); +const pipeline = root + // swapping the default generator with the legacy one + .with(randomGeneratorSlot, BPETER11) + .createGuardedComputePipeline(() => { + 'use gpu'; + const value = randf.sample(); // uses the legacy BPETER11 generator + }); +```` + +## Unified buffer usages and shorthands + +Buffer usages and shorthands are now the same thing, and called "buffer bindings" to better reflect what they actually are. This involves the types `BufferShorthand` and some others being deprecated. + +## Removed APIs + +.value, old pipeline build pattern, old bindGroupLayout API, .bound + +## Recommendation to import from { tgpu } instead of tgpu, {} + +## More strict use of .$uses + +.$uses can now be called only once.