]> zoso.dev Git - libnemo.git/commitdiff
Get rid of extraneous logging in PowGl.
authorChris Duncan <chris@zoso.dev>
Tue, 7 Jan 2025 13:42:30 +0000 (05:42 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 7 Jan 2025 13:42:30 +0000 (05:42 -0800)
src/lib/workers/powgl.ts

index ef1683a2e7fb3b27108bf2a398a1f33544f2800e..82f6bf8f84f5abf4a1227b56d8c4fd1ac04ca5cf 100644 (file)
@@ -343,7 +343,6 @@ void main() {
                const work = new Uint8Array(8)
                let start: DOMHighResTimeStamp
                const draw = (): void => {
-                       start = performance.now()
                        if (PowGl.#gl == null) throw new Error('WebGL 2 is required')
                        if (PowGl.#query == null) throw new Error('WebGL 2 is required to run queries')
                        PowGl.#gl.clear(PowGl.#gl.COLOR_BUFFER_BIT)
@@ -364,20 +363,16 @@ void main() {
                function checkQueryResult () {
                        if (PowGl.#gl == null) throw new Error('WebGL 2 is required to check query results')
                        if (PowGl.#query == null) throw new Error('Query not found')
-                       console.log(`checking (${performance.now() - start} ms)`)
                        if (PowGl.#gl.getQueryParameter(PowGl.#query, PowGl.#gl.QUERY_RESULT_AVAILABLE)) {
-                               console.log(`AVAILABLE (${performance.now() - start} ms)`)
                                const anySamplesPassed = PowGl.#gl.getQueryParameter(PowGl.#query, PowGl.#gl.QUERY_RESULT)
                                if (anySamplesPassed) {
                                        // A valid nonce was found
                                        readBackResult()
                                } else {
-                                       console.log(`not found (${performance.now() - start} ms)`)
                                        // No valid nonce found, start the next draw call
                                        requestAnimationFrame(draw)
                                }
                        } else {
-                               console.log(`not ready (${performance.now() - start} ms)`)
                                // Query result not yet available, check again in the next frame
                                requestAnimationFrame(checkQueryResult)
                        }
@@ -388,7 +383,6 @@ void main() {
                        // Check the pixels for any success
                        for (let i = 0; i < PowGl.#pixels.length; i += 4) {
                                if (PowGl.#pixels[i] !== 0) {
-                                       console.log(`FOUND (${performance.now() - start} ms)`)
                                        const hex = PowGl.#hexify(work.subarray(4, 8)) + PowGl.#hexify([
                                                PowGl.#pixels[i + 2],
                                                PowGl.#pixels[i + 3],