Skip to content

Commit b79b813

Browse files
authored
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)`
1 parent 861e778 commit b79b813

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_pbr/src/render/skin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub fn prepare_skins(
220220
let mut new_size = uniform.current_buffer.size();
221221
while new_size < needed_size {
222222
// 1.5× growth factor.
223-
new_size += new_size / 2;
223+
new_size = (new_size + new_size / 2).next_multiple_of(4);
224224
}
225225

226226
// Create the new buffers.

0 commit comments

Comments
 (0)