Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fps overlay #12382

Merged
merged 21 commits into from Mar 11, 2024
Merged

Fps overlay #12382

merged 21 commits into from Mar 11, 2024

Conversation

matiqo15
Copy link
Member

@matiqo15 matiqo15 commented Mar 8, 2024

Objective

Solution

  • Create FpsOverlayPlugin
  • Allow for configuration through resource FpsOverlayConfig
  • Allow for configuration during runtime

Preview on default settings

20240308_22h23m25s_grim

@matiqo15 matiqo15 added C-Enhancement A new feature A-Dev-Tools Tools used to debug Bevy applications. labels Mar 8, 2024
@alice-i-cecile
Copy link
Member

Can you add an example for this? It should be in its own dev_tools folder :)

@JMS55
Copy link
Contributor

JMS55 commented Mar 8, 2024

Something we should consider in addition to a basic FPS overlay is GPU and GPU timings for rendering: #8067 + #9135. Possibly also using the automatic traces generated from systems to show the top ~10 system times per frame out of all systems.

EDIT: I apologize for the scope creep, but if we're going to add in-app performance overlays, I feel like it's worth showing more data. Just pure FPS is not a great indication of performance. The alternative is we tell people to use tracy every time they run their app, which is already hooked up to give FPS and system timings.

@matiqo15
Copy link
Member Author

matiqo15 commented Mar 8, 2024

Something we should consider in addition to a basic FPS overlay is GPU and GPU timings for rendering: #8067 + #9135. Possibly also using the automatic traces generated from systems to show the top ~10 system times per frame out of all systems.

Fully onboard, but I would prefer for this to be done as a follow up, if that's not a problem.

Copy link
Contributor

@pablo-lua pablo-lua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the state of the tool. I have a couple comments though

examples/dev_tools/fps_overlay.rs Outdated Show resolved Hide resolved
crates/bevy_dev_tools/src/fps_overlay.rs Show resolved Hide resolved
@mockersf
Copy link
Member

mockersf commented Mar 8, 2024

I would like to have a mention in the doc of this that it's always better when possible to use the native overlay of the rendering API. For Metal it's possible by setting the env variable MTL_HUD_ENABLED=1, which render something like
Screenshot 2024-03-09 at 00 35 50

The SteamDeck also has a built in overlay, I don't know if it's something common to Vulkan? Anything for DX12?

@matiqo15
Copy link
Member Author

matiqo15 commented Mar 9, 2024

The SteamDeck also has a built in overlay, I don't know if it's something common to Vulkan? Anything for DX12?

I only found third-party solutions for Vulkan

@matiqo15
Copy link
Member Author

matiqo15 commented Mar 9, 2024

Sorry for force-pushing, accidentally pushed wrong note

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still work to do in terms of exposing a nice API for configuring these things, but I'm happy to get this merged now to enable us to actually have some sample tools to abstract over.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 11, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 11, 2024
Merged via the queue into bevyengine:main with commit 2d29954 Mar 11, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Dev-Tools Tools used to debug Bevy applications. C-Enhancement A new feature S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants