static #bindGroupLayout: GPUBindGroupLayout
static #pipeline: GPUComputePipeline
- static {
- this.init()
- }
+ // static {
+ // this.init()
+ // }
// Initialize WebGPU
static async init (): Promise<void> {
// SPDX-License-Identifier: GPL-3.0-or-later
import { NanoPowGl } from "./gl.js"
-import { NanoPowGpu } from "./gpu.js"
-
-export {
- NanoPowGl,
- NanoPowGpu
+import { NanoPowGpu as gpu } from "./gpu.js"
+console.log(`export barrel`)
+let NanoPowGpu = null
+try {
+ NanoPowGpu = await gpu.init()
+} catch (err) {
+ console.warn(`WebGPU is not supported in this environment.`)
}
+console.log(`barrel`)
+export { NanoPowGl, NanoPowGpu }
<link rel="icon" href="./favicon.ico">
<script type="module" src="../dist/global.min.js"></script>
<!-- Comment out nano-pow from CDN if testing locally -->
- <script type="module" src="https://cdn.jsdelivr.net/npm/nano-pow@1.1.0/dist/global.min.js"></script>
+ <!-- <script type="module" src="https://cdn.jsdelivr.net/npm/nano-pow@1.1.0/dist/global.min.js"></script> -->
<script type="module" src="https://cdn.jsdelivr.net/npm/nano-webgl-pow@1.1.1/nano-webgl-pow.js"></script>
<script type="module">
const { NanoPowGl, NanoPowGpu } = NanoPow