Skip to content

2.17.1

Choose a tag to compare

@fuzzie360 fuzzie360 released this 22 Jul 11:59

Bug-fix release: new GPU() works again in Chrome and Edge.

Fixed

  • new GPU() no longer throws "GPU is not a constructor" in WebGPU-capable browsers (#844, #820). Chrome 113+ and Edge define window.GPU as the native WebGPU interface; the browser bundle saw the name as taken and ended up leaving a plain namespace object on window.GPU instead of the constructor. The bundle now claims the global name correctly:
    • new GPU() works in Chrome, Edge, Firefox, and Web Workers
    • new GPU.GPU() — the widespread workaround — continues to work
    • GPU.Texture, GPU.Input, GPU.input, GPU.utils, etc. remain attached
    • a page that loads gpu.js twice keeps the first copy, as before

Installing

npm install gpu.js@2.17.1
<script src="https://unpkg.com/gpu.js@2.17.1/dist/gpu-browser.min.js"></script>