static #busy: boolean = false
static #debug: boolean = false
static #device: GPUDevice | null = null
- static #gpuBufferReset: BigUint64Array = new BigUint64Array([0n, 0n])
+ static #bufferReset: BigUint64Array = new BigUint64Array([0n, 0n, 0n, 0n])
static #gpuBuffer: GPUBuffer
static #cpuBuffer: GPUBuffer
static #uboBuffer: GPUBuffer
if (this.#debug) console.log('UBO', this.#uboView)
this.#device.queue.writeBuffer(this.#uboBuffer, 0, this.#uboView)
- // Reset `nonce` and `found` to 0u in WORK before each calculation
- this.#device.queue.writeBuffer(this.#gpuBuffer, 0, this.#gpuBufferReset)
+ // Reset WORK properties to 0u before each calculation
+ this.#device.queue.writeBuffer(this.#gpuBuffer, 0, this.#bufferReset)
+ this.#device.queue.writeBuffer(this.#cpuBuffer, 0, this.#bufferReset)
// Bind UBO read and GPU write buffers
const bindGroup = this.#device.createBindGroup({