From b79b8133c881942a42bb359f998bd8792c48c1bc Mon Sep 17 00:00:00 2001 From: robtfm <50659922+robtfm@users.noreply.github.com> Date: Wed, 2 Jul 2025 21:06:27 +0100 Subject: [PATCH] fix skin uniform buffer size (#19888) # Objective for `BufferUsages::STORAGE` on webgpu (and maybe other contexts), buffer sizes must be a multiple of 4. the skin uniform buffer starts at 16384 then increases by 1.5x, which eventually hits a number which isn't ## Solution `.next_multiple_of(4)` --- crates/bevy_pbr/src/render/skin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_pbr/src/render/skin.rs b/crates/bevy_pbr/src/render/skin.rs index 476e06c1e7..f9ec672a66 100644 --- a/crates/bevy_pbr/src/render/skin.rs +++ b/crates/bevy_pbr/src/render/skin.rs @@ -220,7 +220,7 @@ pub fn prepare_skins( let mut new_size = uniform.current_buffer.size(); while new_size < needed_size { // 1.5× growth factor. - new_size += new_size / 2; + new_size = (new_size + new_size / 2).next_multiple_of(4); } // Create the new buffers.