]> zoso.dev Git - libnemo.git/commitdiff
Indicate units when bit shift constructing ID/
authorChris Duncan <chris@zoso.dev>
Wed, 8 Jan 2025 01:24:18 +0000 (17:24 -0800)
committerChris Duncan <chris@zoso.dev>
Wed, 8 Jan 2025 01:24:18 +0000 (17:24 -0800)
src/lib/workers/powgpu.ts

index 43b9359f7c6cacb455d9cc1def770f0529905476..affc177397ff90659398c6e44eed704f80f50be5 100644 (file)
@@ -184,10 +184,10 @@ export class PowGpu extends WorkerInterface {
                        /**
                        * Flatten 3D workgroup and local identifiers into u32 for each thread
                        */
-                       var id: u32 = ((workgroup_id.x & 0xff) << 24) |
-                               ((workgroup_id.y & 0xff) << 16) |
-                               ((workgroup_id.z & 0xff) << 8) |
-                               (local_id.x & 0xff);
+                       var id: u32 = ((workgroup_id.x & 0xFFu) << 24u) |
+                               ((workgroup_id.y & 0xFFu) << 16u) |
+                               ((workgroup_id.z & 0xFFu) << 8u) |
+                               (local_id.x & 0xFFu);
 
                        /**
                        * Initialize (nonce||blockhash) concatenation