Skip to content

Commit f868013

Browse files
authored
Fix crash on meshes with morphs + skins + motion blur when not using storage buffers (#20076)
## Objective Fixes #20058 ## Solution Fix the `dynamic_offsets` array being too small if a mesh has morphs and skins and motion blur, and the renderer isn't using storage buffers (i.e. WebGL2). The bug was introduced in #13572. ## Testing - Minimal repro: https://github.com/M4tsuri/bevy_reproduce. - Also examples `animated_mesh`, `morph_targets`, `test_invalid_skinned_meshes`. - As far as I can tell Bevy doesn't have any examples or tests that can repro the problem combination. Tested with WebGL and native, Win10/Chrome/Nvidia.
1 parent 0d6c591 commit f868013

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_pbr/src/render/mesh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3016,7 +3016,7 @@ impl<P: PhaseItem, const I: usize> RenderCommand<P> for SetMeshBindGroup<I> {
30163016
);
30173017
};
30183018

3019-
let mut dynamic_offsets: [u32; 3] = Default::default();
3019+
let mut dynamic_offsets: [u32; 5] = Default::default();
30203020
let mut offset_count = 0;
30213021
if let PhaseItemExtraIndex::DynamicOffset(dynamic_offset) = item.extra_index() {
30223022
dynamic_offsets[offset_count] = dynamic_offset;

0 commit comments

Comments
 (0)