Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions apps/typegpu-docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,19 @@ export default defineConfig({
},
]),
},
{
label: 'Migrations',
items: stripFalsy([
DEV && {
label: 'Migrating to 0.12',
slug: 'migrations/0-12',
},
{
label: 'Migrating to 0.11',
slug: 'migrations/0-11',
},
]),
},
{
label: 'Tooling',
items: stripFalsy([
Expand Down
32 changes: 32 additions & 0 deletions apps/typegpu-docs/src/content/docs/migrations/0-11.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: Migrating to 0.11
---

The `buffer.writePartial` API is being deprecated in favor of `buffer.patch`.
To migrate, simply replace any partial write of arrays in the form of `[{ idx: 2, value: foo }, /* ... */]` with `{ 2: foo, /* ... */ }`.

Comment on lines +5 to +7
```diff lang=ts
const buffer = root.createBuffer(d.arrayOf(d.vec3f, 5)).$usage('storage');

- buffer.writePartial([{ idx: 2, value: d.vec3f(1, 2, 3) }]);
+ buffer.patch({ 2: d.vec3f(1, 2, 3) });
```

### Stabilizing textures and samplers

One by one, we're making our APIs available without the `['~unstable']` prefix, and this time around, it's **textures** and **samplers**.
Just drop the unstable prefix, and you're good to go.

```diff lang=ts
- const sampler = root['~unstable'].createSampler({
+ const sampler = root.createSampler({
magFilter: 'linear',
minFilter: 'linear',
});

- const texture = root['~unstable'].createTexture({
+ const texture = root.createTexture({
size: [256, 256],
format: 'rgba8unorm' as const,
}).$usage('sampled');
```
4 changes: 4 additions & 0 deletions apps/typegpu-docs/src/content/docs/migrations/0-12.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: Migrating to 0.12
draft: true
---
Loading