Skip to content

Commit 63d4bd3

Browse files
committed
Merge branch 'main' into docs/lcg
2 parents 521c9c3 + e4b42f9 commit 63d4bd3

641 files changed

Lines changed: 29249 additions & 15664 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
lfs: true
19-
- uses: biomejs/setup-biome@v2
2019
- uses: denoland/setup-deno@v2
2120
with:
22-
deno-version: v2.x # Run with latest stable Deno.
21+
deno-version: v2.4.3
2322

2423
- name: Install pnpm
2524
uses: pnpm/action-setup@v4
2625
with:
2726
run_install: false
2827

29-
- name: Use Node.js 22.x
28+
- name: Use Node.js 24.x
3029
uses: actions/setup-node@v4
3130
with:
32-
node-version: 22.x
31+
node-version: 24.x
3332
cache: 'pnpm'
3433

3534
- name: Install dependencies

.github/workflows/pkg-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: pnpm nightly-build
4242

4343
- name: Publish (pkg.pr.new)
44-
run: npx pkg-pr-new publish './packages/typegpu/dist' './packages/typegpu-noise/dist' './packages/unplugin-typegpu/dist' --json output.json --comment=off
44+
run: npx pkg-pr-new publish './packages/typegpu/dist' './packages/typegpu-noise/dist' './packages/unplugin-typegpu/dist' --json output.json --comment=off --pnpm
4545
- name: Post or update comment
4646
uses: actions/github-script@v6
4747
with:

README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ const wgsl = tgpu.resolve([main]);
3737
//
3838
// #3) Executed on the GPU (generates WGSL underneath)
3939
//
40-
root['~unstable']
41-
.createGuardedComputePipeline(main)
42-
.dispatchThreads();
40+
root.createGuardedComputePipeline(main).dispatchThreads();
4341
```
4442

4543
<div align="center">
@@ -138,7 +136,7 @@ API:
138136

139137
```ts
140138
import type { StorageFlag, TgpuBuffer, TgpuRoot } from 'typegpu';
141-
import * as d from 'typegpu/data';
139+
import { d } from 'typegpu';
142140

143141
// We can define schemas, or functions that return schemas...
144142
const HeightMap = (width: number, height: number) =>
@@ -185,14 +183,41 @@ out our [Official Docs](https://docs.swmansion.com/TypeGPU/getting-started)!
185183

186184
<!-- automd:file src="./projects-using-typegpu.md" -->
187185

186+
Libraries:
187+
188+
- [Vivarium](https://github.com/WonderYard/vivarium) - Modern, intuitive,
189+
WebGPU-powered toolkit for creating your own cellular automata
190+
- [wayfare](https://github.com/iwoplaza/wayfare) - A modular game engine built
191+
on top of TypeGPU & Koota
192+
- [typegpu-shader-canvas](https://github.com/AlexJWayne/typegpu-shader-canvas) -
193+
a high-level library that sets up a canvas for you, so you can focus on
194+
delivering pixels with TypeScript functions
195+
- [lilgpu](https://github.com/gnlow/lilgpu) - Lil wrapper to toy with WebGPU,
196+
powered by TypeGPU
197+
- [fisheye.js](https://github.com/GyeongHoKim/fisheye.js/tree/main) - A
198+
JavaScript library for correcting fisheye, or barrel distortion, in images in
199+
the browser
200+
201+
Apps:
202+
203+
- [ComfyUI](https://www.comfy.org/) - An open-source tool for creating
204+
generative AI
188205
- [Chaos Master](https://chaos-master.vercel.app) by deluksic & Komediruzecki
206+
- [Visual timer: Calm Jar](https://apps.apple.com/us/app/visual-timer-calm-jar/id6741375962)
207+
by Nathan Schmidt
208+
209+
Demos:
210+
189211
- [Apollonian Circles](https://deluksic.github.io/apollonian-circles/) by
190212
deluksic
191213
- [Strange Forms](https://github.com/loganzartman/strangeforms) by Logan Zartman
192214
- [WebGPU Stable Fluids](https://github.com/loganzartman/webgpu-stable-fluids)
193215
by Logan Zartman
194-
- [Visual timer: Calm Jar](https://apps.apple.com/us/app/visual-timer-calm-jar/id6741375962)
195-
by Nathan Schmidt
216+
- [Plasma Garden](https://alexwayne.codes/2026-01-11-plasma-garden/) by Alex
217+
Wayne
218+
- [Glowout](https://alexwayne.codes/2025-12-04-glowout/) by Alex Wayne
219+
- [MeloSkia](https://github.com/kimchouard/meloskia) - A music-game demo to
220+
highlight RN-Skia capabilities by Kim Chouard
196221

197222
<!-- /automd -->
198223

apps/bun-example/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import tgpu from 'typegpu';
2-
import * as d from 'typegpu/data';
1+
import tgpu, { d } from 'typegpu';
32
import { randf } from '@typegpu/noise';
43

54
const Boid = d.struct({
65
pos: d.vec3f,
76
});
87

9-
const createRandomBoid = tgpu.fn([], Boid)(() => {
10-
return { pos: randf.inUnitCube() };
11-
});
8+
const createRandomBoid = () => {
9+
'use gpu';
10+
return Boid({ pos: randf.inUnitCube() });
11+
};
1212

1313
const shaderCode = tgpu.resolve([createRandomBoid]);
1414

apps/bun-example/preload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { plugin } from 'bun';
22
import typegpu from 'unplugin-typegpu/bun';
33

4-
plugin(typegpu({ include: /\.(ts)$/ }));
4+
void plugin(typegpu({ include: /\.(ts)$/ }));

apps/infra-benchmarks/src/discriminated-union.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const bench = new Bench({
1010
name: 'discriminated union',
1111
time: 100,
1212
async setup() {
13-
// biome-ignore lint/suspicious/noExplicitAny: making sure GC has no impact on the results
13+
// oxlint-disable-next-line typescript/no-explicit-any making sure GC has no impact on the results
1414
(globalThis as any).gc();
1515
},
1616
});
@@ -43,23 +43,23 @@ bench
4343
.add(
4444
'string tags',
4545
() => {
46-
let count = 0;
46+
let _count = 0;
4747

4848
for (const obj of stringTaggedObjs) {
4949
if (obj[$internal].type === 'aaa') {
50-
count += 2;
50+
_count += 2;
5151
} else if (obj[$internal].type === 'bbb') {
52-
count += 3;
52+
_count += 3;
5353
} else if (obj[$internal].type === 'ccc') {
54-
count += 4;
54+
_count += 4;
5555
}
5656
}
5757
},
5858
{
5959
beforeEach() {
6060
stringTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
6161
[$internal]: {
62-
// biome-ignore lint/style/noNonNullAssertion: in range
62+
// oxlint-disable-next-line typescript/no-non-null-assertion
6363
type: STRING_TAGS[Math.floor(Math.random() * STRING_TAGS.length)]!,
6464
},
6565
}));
@@ -69,23 +69,23 @@ bench
6969
.add(
7070
'number tags',
7171
async () => {
72-
let count = 0;
72+
let _count = 0;
7373

7474
for (const obj of numberTaggedObjs) {
7575
if (obj[$internal].type === NUMBER_TAG_CATALOG.aaa) {
76-
count += 2;
76+
_count += 2;
7777
} else if (obj[$internal].type === NUMBER_TAG_CATALOG.bbb) {
78-
count += 3;
78+
_count += 3;
7979
} else if (obj[$internal].type === NUMBER_TAG_CATALOG.ccc) {
80-
count += 4;
80+
_count += 4;
8181
}
8282
}
8383
},
8484
{
8585
beforeEach() {
8686
numberTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
8787
[$internal]: {
88-
// biome-ignore lint/style/noNonNullAssertion: in range
88+
// oxlint-disable-next-line typescript/no-non-null-assertion
8989
type: NUMBER_TAGS[Math.floor(Math.random() * NUMBER_TAGS.length)]!,
9090
},
9191
}));
@@ -95,23 +95,23 @@ bench
9595
.add(
9696
'number tags (inlined catalog)',
9797
async () => {
98-
let count = 0;
98+
let _count = 0;
9999

100100
for (const obj of numberTaggedObjs) {
101101
if (obj[$internal].type === 0) {
102-
count += 2;
102+
_count += 2;
103103
} else if (obj[$internal].type === 1) {
104-
count += 3;
104+
_count += 3;
105105
} else if (obj[$internal].type === 2) {
106-
count += 4;
106+
_count += 4;
107107
}
108108
}
109109
},
110110
{
111111
beforeEach() {
112112
numberTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
113113
[$internal]: {
114-
// biome-ignore lint/style/noNonNullAssertion: in range
114+
// oxlint-disable-next-line typescript/no-non-null-assertion
115115
type: NUMBER_TAGS[Math.floor(Math.random() * NUMBER_TAGS.length)]!,
116116
},
117117
}));
@@ -121,23 +121,23 @@ bench
121121
.add(
122122
'symbol tags',
123123
async () => {
124-
let count = 0;
124+
let _count = 0;
125125

126126
for (const obj of symbolTaggedObjs) {
127127
if (obj[$internal].type === aaa) {
128-
count += 2;
128+
_count += 2;
129129
} else if (obj[$internal].type === bbb) {
130-
count += 3;
130+
_count += 3;
131131
} else if (obj[$internal].type === ccc) {
132-
count += 4;
132+
_count += 4;
133133
}
134134
}
135135
},
136136
{
137137
beforeEach() {
138138
symbolTaggedObjs = Array.from({ length: NUMBER_OF_OBJS }, () => ({
139139
[$internal]: {
140-
// biome-ignore lint/style/noNonNullAssertion: in range
140+
// oxlint-disable-next-line typescript/no-non-null-assertion
141141
type: SYMBOL_TAGS[Math.floor(Math.random() * SYMBOL_TAGS.length)]!,
142142
},
143143
}));
@@ -147,15 +147,15 @@ bench
147147
.add(
148148
'symbol keys',
149149
async () => {
150-
let count = 0;
150+
let _count = 0;
151151

152152
for (const obj of symbolKeyedObjs) {
153153
if (obj[aaa]) {
154-
count += 2;
154+
_count += 2;
155155
} else if (obj[bbb]) {
156-
count += 3;
156+
_count += 3;
157157
} else if (obj[ccc]) {
158-
count += 4;
158+
_count += 4;
159159
}
160160
}
161161
},
@@ -165,7 +165,7 @@ bench
165165
{ length: NUMBER_OF_OBJS },
166166
() =>
167167
({
168-
// biome-ignore lint/style/noNonNullAssertion: in range
168+
// oxlint-disable-next-line typescript/no-non-null-assertion
169169
[SYMBOL_TAGS[Math.floor(Math.random() * SYMBOL_TAGS.length)]!]:
170170
true,
171171
}) as { [K in (typeof SYMBOL_TAGS)[number]]: boolean },

apps/treeshake-test/compareResults.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function groupResultsByTest(results: typeof BenchmarkResults.infer) {
1919
if (!grouped[result.testFilename]) {
2020
grouped[result.testFilename] = {};
2121
}
22-
// biome-ignore lint/style/noNonNullAssertion: it's there...
22+
// oxlint-disable-next-line typescript/no-non-null-assertion it's there...
2323
grouped[result.testFilename]![result.bundler] = result.size;
2424
}
2525
return grouped;
@@ -46,9 +46,9 @@ async function generateReport(
4646

4747
// Split tests into static and dynamic
4848
const staticTests = [...allTests].filter((t) => !t.includes('_from_'))
49-
.sort();
49+
.toSorted();
5050
const dynamicTests = [...allTests].filter((t) => t.includes('_from_'))
51-
.sort();
51+
.toSorted();
5252

5353
// Summary statistics
5454
let totalDecreased = 0;

apps/treeshake-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"typegpu": "workspace:*",
13-
"unplugin-typegpu": "^0.9.0"
13+
"unplugin-typegpu": "workspace:*"
1414
},
1515
"devDependencies": {
1616
"@types/node": "^20.0.0",
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/** biome-ignore-all lint/correctness/noUnusedImports: it's a test */
21
import tgpu from 'typegpu';
32
import * as d from 'typegpu/data';
43
import * as std from 'typegpu/std';

apps/typegpu-docs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ src/content/docs/api
2626
# tests
2727
tests/artifacts
2828
!tests/artifacts/README.md
29+
30+
# generated transformed files
31+
*.tsnotover.ts
32+
*.tsnotover.tsx

0 commit comments

Comments
 (0)