#25804·bevy

Unusual frame duration behaviour in `deferred_raymarch` example.

Author: Totobird-CreationsCreated Sep 16, 2026Updated Sep 16, 2026
LabelsC-BugC-PerformanceS-Needs-Triage

Bevy version

0.20.0-rc1 from crates.io

Relevant system information

  • rustc 1.100.0-nightly
  • Arch Linux, kernel 7.2.2
  • AMD Ryzen AI 5 340 w/ Radeon 840M
  • AMD ATI Radeon 840M / 860M Graphics

What's performing poorly?

I copy-pasted the shader_advanced/deferred_raymarch example and noticed poor framerate. I figured swapping the raymarch for a cheaper ray-plane intersection function would show improvement, but visually I saw none. After seeking help I was directed here.

The following details all use the deferred_raymarch example and shader files verbatim.

Enabling the FpsOverlayPlugin showed this: Here's another screenshot of the FPS overlay when running at a lower resolution. The same spikes occur at a slower interval. Interestingly, the slow frames are a lot more consistent in a release build: Release build with shadows disabled:

Traces

Here's a tracy capture for a release build, shadows enabled (third screenshot). Github won't let me upload it so I've had to link off-site. Sorry about that. https://file.garden/aO6KoloyWnMvDEjZ/deferred_raymarch-capture.tracy

Additional information

What I find strange is that the frame duration spikes every few frames, instead of a consistent high frame duration that would be expected of a slow rendering process. Speculation: It's almost like there's something running which takes a few frames, that causes a spike when complete. This may explain why the slow frames are more consistent in release.