From 5e458496dc8bdc342bea6cf064d8da62f142463c Mon Sep 17 00:00:00 2001 From: David Ellis Date: Wed, 12 Jun 2024 09:26:53 -0500 Subject: [PATCH] Fix an off-by-one error in the workgroup creation caught by the Raspberry Pi (#767) --- src/std/root.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/std/root.rs b/src/std/root.rs index ab17aecd..32bec069 100644 --- a/src/std/root.rs +++ b/src/std/root.rs @@ -2219,7 +2219,7 @@ fn GPGPU_new_easy<'a>(source: &mut String, buffer: &'a mut wgpu::Buffer) -> GPGP let y_div = z_rem / 65535; let y = y_div + 1; let y_rem = z_rem.wrapping_rem(65535); - let x = y_rem + 1; + let x = std::cmp::max(y_rem, 1); GPGPU::new(source.clone(), vec![vec![buffer]], [x, y, z]) }