From 3740421d27846b435cc88ab20782803228052edb Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 15 Jan 2025 13:17:30 -0800 Subject: [PATCH] Fix bug with GL validate. --- src/classes/gl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/gl.ts b/src/classes/gl.ts index a6e376b..689bf99 100644 --- a/src/classes/gl.ts +++ b/src/classes/gl.ts @@ -216,10 +216,10 @@ export class NanoPowGl { if (this.#gl == null) throw new Error('WebGL 2 is required') if (!/^[A-Fa-f0-9]{16}$/.test(work)) throw new Error(`Invalid work ${work}`) if (!/^[A-Fa-f0-9]{64}$/.test(hash)) throw new Error(`Invalid hash ${hash}`) + const debug = !!(options?.debug) const threshold = (typeof options?.threshold !== 'number' || options.threshold < 0x0 || options.threshold > 0xffffffff) ? 0xfffffff8 : options.threshold - const debug = !!(options?.debug) /** Set up uniform buffer object */ const uboView = new DataView(new ArrayBuffer(144)) @@ -228,7 +228,7 @@ export class NanoPowGl { uboView.setUint32(i * 2, parseInt(uint32, 16)) } uboView.setUint32(128, threshold, true) - uboView.setFloat32(132, 1, true) + uboView.setFloat32(132, NanoPowGl.#WORKLOAD - 1, true) NanoPowGl.#gl.bindBuffer(NanoPowGl.#gl.UNIFORM_BUFFER, NanoPowGl.#uboBuffer) NanoPowGl.#gl.bufferSubData(NanoPowGl.#gl.UNIFORM_BUFFER, 0, uboView) NanoPowGl.#gl.bindBuffer(NanoPowGl.#gl.UNIFORM_BUFFER, null) -- 2.34.1