]> zoso.dev Git - libnemo.git/commitdiff
Try destroying buffers without optional chaining and see if Safari does not complain...
authorChris Duncan <chris@zoso.dev>
Thu, 9 Jan 2025 23:01:48 +0000 (15:01 -0800)
committerChris Duncan <chris@zoso.dev>
Thu, 9 Jan 2025 23:01:48 +0000 (15:01 -0800)
src/lib/nano-pow/classes/gpu.ts

index 686c4c865261abf2ccfabc45da7a68352fa3e9ce..71f14d07211d6b7b536022a9e3a7ea1452402f8c 100644 (file)
@@ -96,9 +96,9 @@ export class NanoPowGpu {
        static reset (loss?: GPUDeviceLostInfo): void {
                console.dir(loss)
                console.warn(`Device lost. Reinitializing...`)
-               this.#cpuBuffer?.destroy()
-               this.#gpuBuffer?.destroy()
-               this.#uboBuffer?.destroy()
+               if (this.#cpuBuffer) this.#cpuBuffer.destroy()
+               if (this.#gpuBuffer) this.#gpuBuffer.destroy()
+               if (this.#uboBuffer) this.#uboBuffer.destroy()
                this.#busy = false
                this.init()
        }