]> zoso.dev Git - nano-pow.git/commitdiff
Log options passed to functions if debugging.
authorChris Duncan <chris@zoso.dev>
Tue, 11 Mar 2025 21:21:17 +0000 (14:21 -0700)
committerChris Duncan <chris@zoso.dev>
Tue, 11 Mar 2025 21:21:17 +0000 (14:21 -0700)
src/classes/gl.ts
src/classes/gpu.ts

index 96349a54af272f9ec21f1201ab418464b29673c0..4f23b6984fa44d5540e0b0e17d18164687eb5591 100644 (file)
@@ -354,6 +354,7 @@ export class NanoPowGl {
                        ? this.#cores
                        : options.effort
                this.#debug = !!(options?.debug)
+               if (this.#debug) console.log('search options', JSON.stringify(options))
 
                /** Reset if user specified new level of effort */
                if (this.#WORKLOAD !== 256 * effort) {
@@ -434,6 +435,7 @@ export class NanoPowGl {
                        ? 0xfffffff8
                        : options.threshold
                this.#debug = !!(options?.debug)
+               if (this.#debug) console.log('validate options', JSON.stringify(options))
 
                if (NanoPowGl.#gl == null) throw new Error('WebGL 2 is required')
                if (this.#gl == null) throw new Error('WebGL 2 is required')
index 2c08a068723a19745046fcfb07a952f67dc55890..dc9b00fb55aba0cb591c15a2ac5a63d81ad0bfd3 100644 (file)
@@ -234,6 +234,7 @@ export class NanoPowGpu {
                        ? 0x800
                        : options.effort * 0x100
                this.#debug = !!(options?.debug)
+               if (this.#debug) console.log('search options', JSON.stringify(options))
 
                // Ensure WebGPU is initialized before calculating
                let loads = 0
@@ -285,10 +286,11 @@ export class NanoPowGpu {
                        })
                }
                this.#busy = true
-               this.#debug = !!(options?.debug)
                const threshold = (typeof options?.threshold !== 'number' || options.threshold < 0x0 || options.threshold > 0xffffffff)
                        ? 0xfffffff8
                        : options.threshold
+               this.#debug = !!(options?.debug)
+               if (this.#debug) console.log('validate options', JSON.stringify(options))
 
                // Ensure WebGPU is initialized before calculating
                let loads = 0