Summary
MeshGeometry.applyMeshData can throw a RangeError when an updatable mesh is updated from a larger vertex count to a smaller one.
Reproduction
- Check out
repro/updatable-mesh-shrink-before from the linked reproduction repository.
- Run
fvm flutter pub get.
- Run
fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/updatable_mesh_shrink_test.dart -d <device-id> --enable-flutter-gpu --enable-impeller.
Observed behavior
The shrink update throws from the GPU upload path:
RangeError (end): Invalid value: Not in inclusive range 0..4032: 4416
ByteData.sublistView
_RingBufferStream.writeRange
MeshGeometry.applyMeshData
The stale range retained by a previously larger mesh extends beyond the smaller snapshot's CPU byte array. In a manual Flutter UI this exception escapes the slider callback, so the slider can appear to stop updating.
Expected behavior
Shrinking and then regrowing an updatable mesh should not attempt to upload bytes outside the current mesh snapshot.
Supporting evidence
The reproduction repository includes a focused failing tag, text evidence, and two supporting Android UI captures. The screenshots are not a same-frame visual comparison; the RangeError and focused integration test are the behavioral evidence.
Summary
MeshGeometry.applyMeshDatacan throw aRangeErrorwhen an updatable mesh is updated from a larger vertex count to a smaller one.Reproduction
7ec6e96cb4b755dc244656a66e203b75622aceaerepro/updatable-mesh-shrink-before64 -> 1 -> 64repro/updatable-mesh-shrink-beforefrom the linked reproduction repository.fvm flutter pub get.fvm flutter drive --driver=test_driver/integration_test.dart --target=integration_test/updatable_mesh_shrink_test.dart -d <device-id> --enable-flutter-gpu --enable-impeller.Observed behavior
The shrink update throws from the GPU upload path:
The stale range retained by a previously larger mesh extends beyond the smaller snapshot's CPU byte array. In a manual Flutter UI this exception escapes the slider callback, so the slider can appear to stop updating.
Expected behavior
Shrinking and then regrowing an updatable mesh should not attempt to upload bytes outside the current mesh snapshot.
Supporting evidence
The reproduction repository includes a focused failing tag, text evidence, and two supporting Android UI captures. The screenshots are not a same-frame visual comparison; the
RangeErrorand focused integration test are the behavioral evidence.