Skip to content

Releases: software-mansion/TypeGPU

typegpu v0.10.2, unplugin-typegpu v0.10.1 (tinyest-for-wgsl v0.3.1), @typegpu/three v0.10.1

06 Mar 16:08

Choose a tag to compare

This release improves the build output of the typegpu package, dramatically improving tree-shaking and reducing the package size by 60%! It also fixes a few paper cuts introduced along with new shell-less render pipelines (and a few others).

For WebGPU interop enthusiasts, TypeGPU pipelines can now be executed as part of an existing command encoder, render pass, or render bundle encoder! (docs coming soon)

🪄 New examples

🚀 Features

  • feat: Render bundle, .with(pass) and .with(encoder) support by @jerzakm in #2200

🗿 Bug fixes / Stability

📖 Docs / DX

New Contributors

Full Changelog: v0.10.0...v0.10.2

v0.10.1

25 Feb 19:20

Choose a tag to compare

This version makes operator overloading function correctly outside of our codebase (tsdown was stripping type defs that it shouldn't have)

What's Changed

  • fix: Allow arguments in rhs of compound assignment by @iwoplaza in #2219
  • fix: Adjust 'typegpu' package import in our Example monaco instance by @iwoplaza in #2218
  • fix: Operator overloading types were erased during build by @iwoplaza in #2225

Full Changelog: v0.10.0...v0.10.1

v0.10.0

24 Feb 17:53
e4b42f9

Choose a tag to compare

TypeGPU v0.10 take ergonomics to the next level, including but not limited to:

  • Operator overloading for vectors and matrices (thanks to "tsover")
  • Shell-less pipelines, with better defaults
  • Compile time ternary operator support
  • for ... of loop support, as well as loop unrolling
  • .rgba swizzles
  • Indirect compute
  • Stabilized tgpu.comptime, tgpu.accessor, tgpu.lazy, pipelines and entry functions

And many more! Check for more details below.

🪄 New examples

🚀 Features

🗿 Bug fixes / Stability

  • fix: Collisions with builtins by @aleksanderkatan in #2002
  • chore: Remove the deprecated asUsage api by @aleksanderkatan in #1999
  • test: Interpolate an array of elements, generic over the size of the array. by @iwoplaza in #2011
  • fix: correct indentation of nested code blocks in wgslGenerator by @Copilot in #2025
  • fix(@typegpu/three): Let Three.js infer type of new THREE.Color() passed into t3.uniform() by @iwoplaza in #2035
  • bump: @typegpu/three 0.9.1 by @iwoplaza in #2036
  • fix: Better error message when assigning to a value defined outside TGSL by @aleksanderkatan in #1981
  • fix: Remove unnecessary any in @typegpu/three internals by @iwoplaza in #2045
  • fix: Remove redundant .with slot calls & chore: Cleanup ItemStateStack by @aleksanderkatan in #1853
  • impr: Name on a bound fn by @aleksanderkatan in #2070
  • fix/feat: Fix type in textureSampleCompare and add textureSampleCompareLevel by @reczkok in #2006
  • feat: Variance annotation overrides to achieve better type behavior by @iwoplaza in #2073
  • fix: More tree-shakeable and convenient exports by @iwoplaza in #2068
  • feat: More predictable dual-impl behavior by @iwoplaza in #2085
  • fix: Improve perlin noise internals and API with accessors by @iwoplaza in #2065
  • refactor: Double down on BaseData by @iwoplaza in #2092
  • impr: Ignore console.logs in vertex shaders by @aleksanderkatan in #1985
  • fix: Proper type coersion for vector & scalar operations by @iwoplaza in #2106
  • feat: Better errors for illegal arguments in shellless by @aleksanderkatan in #2124
  • fix: Better no color attachment handling by @reczkok in #2148
  • impr: Refine std function and conversion handling by @reczkok in #2126
  • feat: Limit overflow suggestions by @aleksanderkatan in #2146
  • fix: intermediate representation of array expression by @cieplypolar in #2021
  • impr: Remove unnecessary nested blocks in seed functions by @cieplypolar in #2086
  • impr: Make clouds use the texture.write() API and move from rgba8unorm to r8unorm since only one channel was used by @reczkok in #2157
  • fix: Disallow missing varyings in shell-less fragment input by @iwoplaza in #2165
  • chore: Make swizzles tiny by @iwoplaza in #2171
  • refactor: Remove unused generateSwizzleFunctions.ts script by @iwoplaza in #2207
  • feat: Rename d.getOffsetInfoAt to d.memoryLayoutOf by @iwoplaza in #2205
  • impr: block scopes in the nameRegistry by @cieplypolar in #2177
  • impr: block externals by @cieplypolar in #2188
  • fix: Alter entry points to support older TypeScript versions, maintain deprecated JSDocs in stabilized ['~unstable'] APIs by @iwoplaza in #2212

📖 Docs / DX

Read more

v0.9.0

22 Dec 20:50

Choose a tag to compare

typegpu 0.9.0, tinyest 0.2.0, tinyest-for-wgsl 0.2.0, @typegpu/* 0.9.0

TypeGPU 0.9.0 brings improvements to compile-time capabilities of JS-shaders, as well as an exciting new integration with Three.js, where any TSL node in a material can be granularly replaced with a TypeGPU function.

🪄 New examples

🚀 Features

📖 Docs / DX

🗿 Bug fixes / Stability

  • fix: Indexing constants with runtime indices should properly adjust by @iwoplaza in #1922
  • fix: Disallow references in arrays by @aleksanderkatan in #1990
  • fix: Fix errors and types around textures by @reczkok in #1950
  • fix: Accessor of static value has unknown type by @lursz in #1964
  • fix: Giving local declarations unique names if they clash with global declarations, and vice-versa + 'strict' the default naming scheme in pipelines by @iwoplaza in #2000
  • chore: Remove 'createDualImpl' by @iwoplaza in #1961
  • test(unplugin-typegpu): Add tests for 'use gpu' marked object method by @cieplypolar in #1894
  • chore: Remove does from entrypoints by @aleksanderkatan in #1997

🧪 Experimental / WIP

Full Changelog: v0.8.2...v0.9.0

v0.8.2

06 Nov 12:50
b754154

Choose a tag to compare

What's Changed

Full Changelog: v0.8.1...v0.8.2

v0.8.1

04 Nov 17:10
4757576

Choose a tag to compare

🗿 Fixes/Stability

📖 Docs/DX

  • fix(docs): Use a more widely supported image source in Jelly Slider number atlas by @reczkok in #1878
  • docs: Soft shadows & bounce lighting in the "Jelly Slider" example by @iwoplaza in #1881

Full Changelog: v0.8.0...v0.8.1

v0.8.0

30 Oct 13:33
5d59c43

Choose a tag to compare

We're excited to release TypeGPU 0.8! Here are the main highlights:

  • console.log on the GPU, a familiar way to debug code execution brought to shaders
  • Simpler and more flexible TypeGPU shader functions (just ‘use gpu’ at the beginning of a function)
  • Overhauled texture APIs (e.g. automatic mip-maps)

You can now install new versions of these packages:

  • typegpu v0.8.0
  • @typegpu/color v0.8.0
  • @typegpu/noise v0.8.0
  • @typegpu/sdf v0.8.0
  • unplugin-typegpu v0.8.0

Migration guide

If you have any uses of the 'kernel'; directive placed at beginning of some functions, you can change it to the 'use gpu'; directive. It functions the same, just with a clearer name.

🚀 Features

🗿 Bug fixes / Stability

📖 Docs/DX

Full Changelog: v0.7.1...v0.8.0

typegpu v0.7.1, @typegpu/color v0.7.0, @typegpu/noise v0.7.0, @typegpu/sdf v0.7.0

18 Aug 12:55

Choose a tag to compare

  • bump: typegpu 0.7.1, @typegpu/color 0.7.0, @typegpu/noise 0.7.0, @typegpu/sdf 0.7.0 by @iwoplaza in #1596

🚀 Features

🗿 Fixes / Stability

📖 Docs / DX

Full Changelog: v0.7.0...v0.7.1

typegpu v0.7.0, unplugin-typegpu v0.2.2

04 Aug 16:47
7ee45d3

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

Choose a tag to compare

🚀 Features

🗿 Bug fixes / Stability

📖 Docs / DX

🧪 Unstable features

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