From 2472f09e1126fdb638d678aa359e9e6d08704d33 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sun, 5 Jan 2025 03:27:39 -0800 Subject: [PATCH] Reintroduce workload variable to allow hardware to control workgroup size, considered most important control in that regard. --- src/lib/workers/powgpu.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/workers/powgpu.ts b/src/lib/workers/powgpu.ts index 61e8543..e3a8518 100644 --- a/src/lib/workers/powgpu.ts +++ b/src/lib/workers/powgpu.ts @@ -43,6 +43,8 @@ export class PowGpu extends WorkerInterface { }) } + static workload = 256 + // WebGPU Compute Shader static #shader = ` struct UBO { @@ -145,7 +147,7 @@ export class PowGpu extends WorkerInterface { * 8-byte work is split into two 4-byte u32. Low 4 bytes are random u32 from * UBO. High 4 bytes are the random value XOR'd with index of each thread. */ - @compute @workgroup_size(256) + @compute @workgroup_size(${this.workload}) fn main( @builtin(workgroup_id) workgroup_id: vec3, @builtin(local_invocation_id) local_id: vec3 -- 2.34.1