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.
This commit is contained in:
parent
0d6c591491
commit
f8680135ed
@ -3016,7 +3016,7 @@ impl<P: PhaseItem, const I: usize> RenderCommand<P> for SetMeshBindGroup<I> {
|
||||
);
|
||||
};
|
||||
|
||||
let mut dynamic_offsets: [u32; 3] = Default::default();
|
||||
let mut dynamic_offsets: [u32; 5] = Default::default();
|
||||
let mut offset_count = 0;
|
||||
if let PhaseItemExtraIndex::DynamicOffset(dynamic_offset) = item.extra_index() {
|
||||
dynamic_offsets[offset_count] = dynamic_offset;
|
||||
|
Loading…
Reference in New Issue
Block a user