From 966ba6c5bc77b5049b8a5ea88758b99157043bd7 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 9 Jan 2025 15:01:48 -0800 Subject: [PATCH] Try destroying buffers without optional chaining and see if Safari does not complain about that. --- src/lib/nano-pow/classes/gpu.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/nano-pow/classes/gpu.ts b/src/lib/nano-pow/classes/gpu.ts index 686c4c8..71f14d0 100644 --- a/src/lib/nano-pow/classes/gpu.ts +++ b/src/lib/nano-pow/classes/gpu.ts @@ -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() } -- 2.34.1