updated mesh with custom pipeline is not rendered until next frame
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.13.2
If your bug is rendering-related, copy the adapter info that appears when you run Bevy.
`AdapterInfo { name: "NVIDIA GeForce RTX 2060 with Max-Q Design", vendor: 4318, device: 7954, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "517.00", backend: Vulkan }`
## What you did
update mesh with `insert_attribute` `Mesh::ATTRIBUTE_POSITION`, to the snapped cursor position on an event that fires when this position changes. Uses a custom pipeline.
## What went wrong
After some troubleshooting I've determined that mesh updates with custom pipeline is not rendered until next frame. This usually isn't noticeable, but when combined with grid snapping and events, will always be lagging behind correctly rendered elements.

briefly, the red square is a quad which transform is updated to the snapped cursor position. The green triangle has a point in the mesh which is updated to the snapped cursor position. The white line has a point which is updated to do the same, and is rendered through a custom pipeline. Position updates happen upon an event generated when the snapped cursor position changes.
The updated mesh is not drawn until the next event, at which point the newly rendered mesh is outdated. Moving the camera does not rectify the rendered shapes.
## Additional information
https://github.com/ua-kxie/circe/tree/bevy-dev
A minimal program reproducing this problem is included as the sole example in this branch (`cargo run --example scratch`) which was used to produce the screenshot above.
Contributor guide
Research direction
Run `cargo run --example scratch` from the linked `bevy-dev` branch to reproduce the one-frame delay, then trace the mesh update and custom-pipeline rendering path. Done means a mesh position changed by the snapped-cursor event is rendered in the same frame rather than on the next event.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100