],
})
- // Create command encoder to issue commands to GPU and initiate render pass
+ // Create command encoder to issue commands to GPU and initiate computation
const commandEncoder = PowGpu.#device.createCommandEncoder()
const passEncoder = commandEncoder.beginComputePass()
- // Issue commands and end render pass
+ // Issue commands and end compute pass structure
passEncoder.setPipeline(PowGpu.#pipeline)
passEncoder.setBindGroup(0, bindGroup)
- passEncoder.dispatchWorkgroups(256)
+ passEncoder.dispatchWorkgroups(256, 256, 256)
passEncoder.end()
// Copy 8-byte nonce and 4-byte found flag from GPU to CPU for reading
12
)
- // End frame by passing array of command buffers to command queue for execution
+ // End computation by passing array of command buffers to command queue for execution
PowGpu.#device.queue.submit([commandEncoder.finish()])
// Read results back to Javascript and then unmap buffer after reading