return
}
+
// Set up uniform buffer object
// Note: u32 size is 4, but total alignment must be multiple of 16
const uboView = new DataView(new ArrayBuffer(48))
uboView.setUint32(36, threshold, true)
PowGpu.#device.queue.writeBuffer(PowGpu.#uboBuffer, 0, uboView)
- // Work buffer
+ // Reset offset 8 `found` flag to 0u in WORK before each calculation
+ PowGpu.#device.queue.writeBuffer(PowGpu.#gpuBuffer, 8, new Uint32Array([0]))
+
+ // Bind UBO read and GPU write buffers
const bindGroup = PowGpu.#device.createBindGroup({
layout: PowGpu.#bindGroupLayout,
entries: [