Skip to content

Releases: software-mansion/TypeGPU

typegpu v0.7.0, unplugin-typegpu v0.2.2

04 Aug 16:47
7ee45d3
Compare
Choose a tag to compare

TypeGPU 0.7.0 is full of quality-of-life features that we're excited for you to try out!

Default constructors for schemas

Ever had to construct an initial (zero'ed out) value that matches your custom schema? It's just become extremely simple! You can now call any schema, and in return, you'll receive a zero-initialized value.

const Boid = d.struct({
  pos: d.vec3f,
  vel: d.vec3f,
});

const BoidArray = d.arrayOf(Boid, 4);

const boids = BoidArray(); // ✨
console.log(boids.length); // prints 4
console.log(boids[0].pos.x); // prints 0

🧪 Fluent interface (or infix operators*)

Up until 0.7, adding two vectors together in TGSL was only possible with the std.add function, but now, vectors and matrices have operator methods on them! This way, you can chain operations in a way that's more readable.

// before 0.7.0
std.add(std.mul(v1, 2), v2);
// 0.7.0
v1.mul(2).add(v2);

🧪 Simulating GPU behavior

An experimental API for simulating GPU-behavior on the CPU has been introduced, called "tgpu.simulate". It's useful for unit-testing your shaders, precomputing parts of your pipeline, etc.

import { perlin2d } from '@typegpu/noise';

const { result } = tgpu.simulate(() => {
  // Executed on the CPU, behaves like it's on the GPU
  return perlin2d.sample(d.vec2f(1.1, 2.2));
});

New Online Tool: "Shader Translator"

Curious what optimizations are performed on your shader code before it gets executed? How does TGSL look like when compiled into WGSL? @reczkok has been hard at work on a new tool just for that! Check it out here: https://typegpu.com/translator

image

Changelog

🚀 Features

🗿 Bug fixes / Stability

  • fix: Proper type for .value and .$ in TypeGPU variables by @iwoplaza in #1482
  • fix: Export TgpuQuerySet by @reczkok in #1552
  • fix: Add support for packed vertex formats in compiled writer and improve the writer selection logic by @reczkok in #1560
  • fix: Rework how schemas propagate usage validity by @iwoplaza in #1547
  • fix(unplugin-typegpu): Create proper AST for TypeGPU metadata by @reczkok in #1498
  • fix(unplugin-typegpu): TypeGPU functions using TGSL dependencies declaration order by @aleksanderkatan in #1522
  • fix(unplugin-typegpu): Plugin should parse files with TS syntax support by @iwoplaza in #1516
  • chore: Clarifying purpose of execution modes by @iwoplaza in #1468

📖 Docs / DX

🧪 Experimental APIs

New Contributors

Full Changelog: v0.6.0...v0.7.0

v0.6.0

10 Jul 12:05
cf4b1f7
Compare
Choose a tag to compare

🚀 Features

🗿 Bug fixes / Stability

📖 Docs / DX

🧪 Unstable features

Full Changelog: v0.5.9...v0.6.0

v0.5.9

18 Jun 11:49
b4fdc5f
Compare
Choose a tag to compare
  • bump: typegpu 0.5.9, typegpu-noise 0.0.9, unplugin-typegpu 0.1.3 by @iwoplaza in #1380

🚀 Features

🗿 Fixes/Stability improvements

📖 Docs/DX

🧪 Experimental APIs

New Contributors

Full Changelog: v0.5.8...v0.5.9

v0.5.8

27 May 16:37
9a75abe
Compare
Choose a tag to compare

🚀 Features

🗿 Stability/Fixes

📖 Docs/DX

🧪 Experimental APIs

Full Changelog: v0.5.7...v0.5.8

v0.5.7

14 May 15:11
f54f66c
Compare
Choose a tag to compare

What's Changed

🚀 Features

  • feat(typegpu): std.sign by @iwoplaza in #1205
  • feat(typegpu): std.textureLoad, std.textureStore, std.textureDimensions, std.textureSampleLevel by @reczkok in #1181
  • feat(typegpu): std.sqrt, std.div by @reczkok in #1189
  • feat: Allow for...of statement to work with vectors and matrices by @mhawryluk in #1226
  • feat(typegpu/color): Add Oklab color space by @deluksic in #1194
  • feat(typegpu/color): Use accessor for OKLab alpha by @iwoplaza in #1228
  • feat: More partial InferPartial, publicize InferGPU & InferPartial by @iwoplaza in #1215

🗿 Stability/Internals

  • refactor: Using $internal symbol for storing internals in plain sight by @iwoplaza in #1182
  • fix: std.select type signature should accept scalar values by @iwoplaza in #1203
  • refactor: Reuse sign and sqrt in @typegpu/noise by @deluksic in #1212
  • feat: Store labels of objects on globalThis by @aleksanderkatan in #1221

📖 Docs/DX

🧪 Unstable APIs

  • feat: Texture std expansion and generator adjustments by @reczkok in #1189
  • fix: Handle single-line statements in TGSL if/for/while by @mhawryluk in #1224
  • impr: Throw error when trying to define tgpu.derived during resolution by @mhawryluk in #1223
  • impr: Add automatic type conversions when possible by @reczkok in #1136
  • fix: Revert object args fn API in examples (+cleanup), fix boolean literals assigned to variable declarations in TGSL by @iwoplaza in #1229
  • feat(unplugin-typegpu): Support TS as and satisfies in TGSL by @mhawryluk in #1240

Full Changelog: v0.5.6...v0.5.7

v0.5.6

22 Apr 16:25
648c995
Compare
Choose a tag to compare

What's Changed

  • build(deps): bump vitest from 3.0.9 to 3.1.1 by @dependabot in #1157
  • build(deps-dev): bump wesl from 0.6.0-rc1 to 0.6.0-rc4 by @dependabot in #1156
  • feat: A more extensible & efficient "tinyest" format by @iwoplaza in #1170
  • refactor: Use internal symbol to identify TypeGPU-originating values by @iwoplaza in #1171
  • bump: typegpu 0.5.6, others non-alpha by @mhawryluk in #1183
  • refactor: Replace remaining references of the name "smol" by @mhawryluk in #1168

📖 Docs/DX

  • fix(docs): Cubemap Reflection example assets by @iwoplaza in #1164
  • docs: Ecosystem scaffold by @iwoplaza in #1150
  • impr: Add touch events support for camera orbit control in cubemap reflection example by @reczkok in #1166
  • docs: Use-cases of TypeGPU in README by @iwoplaza in #1144

Full Changelog: v0.5.5...v0.5.6

v0.5.5

15 Apr 06:40
4a4df97
Compare
Choose a tag to compare

BREAKING - remove .populate method

🗿 Stability/fixes

📖 Docs/DX

🧪 Unstable APIs

  • fix: Function call member access type inference by @reczkok in #1062
  • feat: Update tgpu-gen to generate the latest function API, skip non-entry by @mhawryluk in #1116
  • fix: Entry functions arg type externals replacement with string wgsl implementation by @iwoplaza & @mhawryluk in #1111
  • feat: Allow passing raw wgsl implementation to shell à la template literal by @aleksanderkatan in #1128
  • fix: Function resolve bug fixes by @mhawryluk in #1131
  • fix(tinyest-for-wgsl): Extracting destructured args with babel parser by @mhawryluk in #1143
  • bump: tinyest-for-wgsl & unplugin-typegpu v0.1.0-alpha.9 by @mhawryluk in #1152
  • fix(unplugin-typegpu): source-map misalignment when removing directives (& @ark/attest) by @iwoplaza in #1151
  • bump: typegpu v0.5.5 by @mhawryluk in #1153

Full Changelog: v0.5.4...v0.5.5

v0.5.4

04 Apr 18:58
a9548fc
Compare
Choose a tag to compare

🚀 Features

🗿 Stability/internals

  • chore: Detect structs based on symbol tag & migrate every schema to use $repr instead of ~repr by @iwoplaza in #1091
  • fix: Apply missing Prettify calls by @reczkok in #1105

📖 Docs/DX

  • build(deps): bump acorn from 8.14.0 to 8.14.1 by @dependabot in #1069
  • fix: Add await to dynamic import in StackBlitz example by @reczkok in #1103
  • chore: Verify that the tag used for publishing matches the version number by @iwoplaza in #1067
  • bump: typegpu v0.5.4, unplugin-typegpu v0.1.0-alpha.8, tinyest, tinyest-for-wgsl by @mhawryluk in #1109

🧪 Unstable APIs

This release introduces a breaking change for the unstable computeFn, vertexFn and fragmentFn APIs. Please refer to the "Functions" guide 🙌

Full Changelog: v0.5.3...v0.5.4

v0.5.3

28 Mar 16:55
Compare
Choose a tag to compare

🗿 Fixes/Stability

  • impr: Switch to 'es2024' target, 7x speed gain for vector creation by @reczkok in #1063
  • fix: Taking into account decorated non-primitives in compiled IO by @iwoplaza in #1095
  • bump: typegpu v0.5.3, @typegpu/noise v0.0.4 by @iwoplaza in #1086

📖 Docs/DX

🧪 Experimental features

Full Changelog: v0.5.2...v0.5.3

v0.5.2

24 Mar 15:06
Compare
Choose a tag to compare

🗿 Bug fixes / Stability

  • fix: Handle decorated data in compiledIO and add some tests by @reczkok in #1043

🧪 Unstable features

  • feat: Handle ArrayExpression in TGSL and switch to WESL parser by @reczkok in #1032
  • 🥗: Utility modules starter by @iwoplaza in #807

📖 Docs / DX

Full Changelog: v0.5.1...v0.5.2