diff --git a/src/gallium/frontends/rusticl/core/kernel.rs b/src/gallium/frontends/rusticl/core/kernel.rs index 301a0bca289..1548ebc77be 100644 --- a/src/gallium/frontends/rusticl/core/kernel.rs +++ b/src/gallium/frontends/rusticl/core/kernel.rs @@ -1005,7 +1005,7 @@ impl Kernel { let total_threads = block.iter().take(work_dim).product::(); if threads != 1 && total_threads < subgroups { for i in 0..work_dim { - if grid[i] * total_threads < threads { + if grid[i] * total_threads < threads && grid[i] * block[i] <= dim_threads[i] { block[i] *= grid[i]; grid[i] = 1; // can only do it once as nothing is cleanly divisible