@tapez/core 0.0.0-alpha.3 → 0.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +33 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @tapez/core
2
+
3
+ Typed GPU schema system for WebGPU.
4
+
5
+ Define a GPU struct once — get a type-safe buffer wrapper **and** the WGSL struct definition, guaranteed to stay in sync.
6
+
7
+ ```ts
8
+ import * as tapez from '@tapez/core'
9
+
10
+ const RowsConfig = tapez.struct('RowsConfig', {
11
+ midPrice: tapez.f32,
12
+ rowHeight: tapez.f32,
13
+ decimals: tapez.u32,
14
+ })
15
+
16
+ // In your entity:
17
+ const buf = tapez.TypedBuffer.createUniform(device, RowsConfig, 'config')
18
+ buf.set.midPrice(50000.5)
19
+ buf.set.decimals(2)
20
+ buf.writeIfDirty(queue)
21
+ ```
22
+
23
+ The same schema emits a WGSL struct via `RowsConfig.toWGSL()`, consumable in shaders through [`@tapez/vite`](../vite)'s `@import` syntax.
24
+
25
+ ## Contents
26
+
27
+ - **Schemas** — `f32`, `u32`, `i32`, `vec2f/3f/4f`, `mat2x2f/3x3f/4x4f`, `struct`, `arrayOf`, `const`, `atomic`
28
+ - **TypedBuffer** — named setters, dirty tracking, factory methods
29
+ - **Bind helpers** — `uniformEntry`, `storageEntry`, `bufferEntry`
30
+
31
+ ## Status
32
+
33
+ Alpha. API may change.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapez/core",
3
- "version": "0.0.0-alpha.3",
3
+ "version": "0.0.0-alpha.4",
4
4
  "description": "Typed GPU schema system for WebGPU",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -31,4 +31,4 @@
31
31
  "publishConfig": {
32
32
  "access": "public"
33
33
  }
34
- }
34
+ }