}
const random = Math.floor((Math.random() * 0xffffffff))
uboView.setUint32(32, random, true)
- uboView.setUint32(36, threshold, true)
+ uboView.setUint32(36, random, true)
+ uboView.setUint32(40, threshold, true)
this.#device.queue.writeBuffer(this.#uboBuffer, 0, uboView)
// Reset `nonce` and `found` to 0u in WORK before each calculation
struct UBO {
blockhash: array<vec4<u32>, 2>,
- random: u32,
+ random: vec2<u32>,
threshold: u32
};
@group(0) @binding(0) var<uniform> ubo: UBO;
/**
* Initialize (nonce||blockhash) concatenation
*/
- var m0: u32 = ubo.random ^ id.x;
- var m1: u32 = ubo.random ^ id.y;
+ var m0: u32 = ubo.random.x ^ id.x;
+ var m1: u32 = ubo.random.y ^ id.y;
var m2: u32 = ubo.blockhash[0u].x;
var m3: u32 = ubo.blockhash[0u].y;
var m4: u32 = ubo.blockhash[0u].z;