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

Animating Materials performs poorly sometimes #11537

Closed
atlv24 opened this issue Jan 26, 2024 · 1 comment
Closed

Animating Materials performs poorly sometimes #11537

atlv24 opened this issue Jan 26, 2024 · 1 comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Performance A change motivated by improving speed, memory usage or compile times P-Regression Functionality that used to work but no longer does. Add a test for this!

Comments

@atlv24
Copy link
Contributor

atlv24 commented Jan 26, 2024

Bevy version

latest main

Relevant system information

Please include:

  • rustc 1.75.0
  • Windows 10

What's performing poorly?

Updating many materials per frame. Repro by pointing NSight in frame debugger mode at the binary built by cargo build --example animated_material --release once #11524 is merged.

It looks like material updates are making gargantuan amounts of buffer memory barriers interleaved with coherent buffer copies, but the exact number of them changes per run. Sometimes its way more than others, but always regular per-frame for any given run. Frametime varies, sometimes it hovers around 3.6ms, other times around 12-14ms.

I suspect a system ordering ambiguity may be causing the inconsistency of the performance issue.

A bad run looks like this in NSight:
image

A good run looks like this:
image

Notice the amount of orange interleaved vkCmdCopyBuffer + vkCmdPipelineBarriers.

@atlv24 atlv24 added C-Bug An unexpected or incorrect behavior C-Performance A change motivated by improving speed, memory usage or compile times P-Regression Functionality that used to work but no longer does. Add a test for this! S-Needs-Triage This issue needs to be labelled labels Jan 26, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Jan 26, 2024
@atlv24
Copy link
Contributor Author

atlv24 commented Jan 27, 2024

Fixed by #11383

@atlv24 atlv24 closed this as completed Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior C-Performance A change motivated by improving speed, memory usage or compile times P-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

No branches or pull requests

2 participants