From 3acac093fdbb43992da7108c2acaf51d84a2fc07 Mon Sep 17 00:00:00 2001 From: Kent Slaney Date: Mon, 3 Mar 2025 06:16:57 -0800 Subject: [PATCH] msl bitmask fix (#7255) --- wgpu-hal/src/metal/command.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wgpu-hal/src/metal/command.rs b/wgpu-hal/src/metal/command.rs index 7de30feb7b..2bbacecb61 100644 --- a/wgpu-hal/src/metal/command.rs +++ b/wgpu-hal/src/metal/command.rs @@ -1256,8 +1256,7 @@ impl crate::CommandEncoder for super::CommandEncoder { .zip(pipeline.work_group_memory_sizes.iter()) .enumerate() { - const ALIGN_MASK: u32 = 0xF; // must be a multiple of 16 bytes - let size = ((*pipeline_size - 1) | ALIGN_MASK) + 1; + let size = pipeline_size.next_multiple_of(16); if *cur_size != size { *cur_size = size; encoder.set_threadgroup_memory_length(index as _, size as _);