Community PR harvest — seven long-open pull requests merged, some waiting since 2021. Thank you all.
Fixed
- Helper functions receiving arguments in a different order than the kernel no longer get wrong argument bit ratios (#846, thanks @ChenZhuoSteve; earlier partial fix in #731 by @exebetche)
addFunction()with a function-string source no longer throws (#729, thanks @m0ose)- WebGL feature detection no longer crashes in Web Workers / OffscreenCanvas environments (#779, thanks @jbghoul — fixes #778)
- Minified browser bundles are now pure ASCII, fixing Safari regex errors from re-encoded sources (#744, thanks @jbghoul — fixes #743)
getPixels()TypeScript return type corrected toUint8ClampedArray(#837, thanks @stity)
Changed
- Compile-time speedup: constant lookup arrays hoisted out of per-AST-node methods (#713, thanks @wwwzbwcom)
- Deprecated
substr()replaced withslice()(#747, thanks @CommanderRoot) - New demo: animated parallel raytracer (#833, thanks @jin)
Note: #824 (cropped rendering) was merged and then reverted in this same release — its viewport clamp breaks framebuffer-texture rendering; details on the PR.
Installing
npm install gpu.js@2.19.1<script src="https://unpkg.com/gpu.js@2.19.1/dist/gpu-browser.min.js"></script>