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 definewindow.GPUas the native WebGPU interface; the browser bundle saw the name as taken and ended up leaving a plain namespace object onwindow.GPUinstead of the constructor. The bundle now claims the global name correctly:new GPU()works in Chrome, Edge, Firefox, and Web Workersnew GPU.GPU()— the widespread workaround — continues to workGPU.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>