]> zoso.dev Git - libnemo.git/commitdiff
Upload new bundle for testing.
authorChris Duncan <chris@zoso.dev>
Wed, 8 Jan 2025 22:55:49 +0000 (14:55 -0800)
committerChris Duncan <chris@zoso.dev>
Wed, 8 Jan 2025 22:55:49 +0000 (14:55 -0800)
global.min.js

index ebb54aca3c069b7dcea1b125b602564d08b4c139..b0960509ea70d94c56dc04d42ac656422c5d1d8e 100644 (file)
@@ -4582,7 +4582,7 @@ var init_shaders = __esm({
 });
 
 // src/lib/nano-pow/classes/gl.ts
-var NanoPowGl, gl_default;
+var NanoPowGl;
 var init_gl = __esm({
   "src/lib/nano-pow/classes/gl.ts"() {
     "use strict";
@@ -4779,16 +4779,11 @@ var init_gl = __esm({
         throw new Error("Query reported result but nonce value not found");
       }
     };
-    gl_default = `
-       const NanoPowGlFragmentShader = \`${NanoPowGlFragmentShader}\`
-       const NanoPowGlVertexShader = \`${NanoPowGlVertexShader}\`
-       const PowGl = ${NanoPowGl}
-`;
   }
 });
 
 // src/lib/nano-pow/classes/gpu.ts
-var NanoPowGpu, gpu_default;
+var NanoPowGpu;
 var init_gpu = __esm({
   "src/lib/nano-pow/classes/gpu.ts"() {
     "use strict";
@@ -4816,7 +4811,9 @@ var init_gpu = __esm({
           adapter.requestDevice().then((device) => {
             this.#device = device;
             this.#device.lost.then((loss) => {
-              console.warn(`(${loss.reason}) ${loss.message}. Reinitializing device.`);
+              console.dir(loss);
+              console.warn(loss.reason, loss.message);
+              console.warn(`Device lost. Reinitializing...`);
               this.init();
             });
             this.#uboBuffer = this.#device.createBuffer({
@@ -4921,29 +4918,25 @@ var init_gpu = __esm({
           12
         );
         this.#device.queue.submit([commandEncoder.finish()]);
+        await this.#cpuBuffer.mapAsync(GPUMapMode.READ);
+        await this.#device.queue.onSubmittedWorkDone();
         try {
-          await this.#cpuBuffer.mapAsync(GPUMapMode.READ);
-          await this.#device.queue.onSubmittedWorkDone();
+          const data = new DataView(this.#cpuBuffer.getMappedRange());
+          const nonce = data.getBigUint64(0, true);
+          const found = !!data.getUint32(8);
+          this.#cpuBuffer.unmap();
+          if (found) {
+            const hex2 = nonce.toString(16).padStart(16, "0");
+            return hex2;
+          } else {
+            return await this.search(hash2, threshold);
+          }
         } catch (err) {
           console.warn(`Error getting data from GPU, retrying. ${err}`);
           return await this.search(hash2, threshold);
         }
-        const data = new DataView(this.#cpuBuffer.getMappedRange());
-        const nonce = data.getBigUint64(0, true);
-        const found = !!data.getUint32(8);
-        this.#cpuBuffer.unmap();
-        if (found) {
-          const hex2 = nonce.toString(16).padStart(16, "0");
-          return hex2;
-        } else {
-          return await this.search(hash2, threshold);
-        }
       }
     };
-    gpu_default = `
-       const NanoPowGpuComputeShader = \`${NanoPowGpuComputeShader}\`
-       const NanoPowGpu = ${NanoPowGpu}
-`;
   }
 });