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))
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)