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

PerformanceMonitor's onFallback gets called when it's not flip-flopping #1739

Open
neil-morrison44 opened this issue Dec 4, 2023 · 0 comments · May be fixed by #1791
Open

PerformanceMonitor's onFallback gets called when it's not flip-flopping #1739

neil-morrison44 opened this issue Dec 4, 2023 · 0 comments · May be fixed by #1791
Labels
bug Something isn't working

Comments

@neil-morrison44
Copy link

  • three version: 0.156.1
  • @react-three/fiber version: 8.14.3
  • @react-three/drei version: 9.86.3
  • node version: 20
  • npm (or yarn) version: 9.6.7

Problem description:

This might be me misunderstanding what a "flip-flop" is - but I'd have expected it to only get called when it does a series of onDecline / onIncline calls, rather than the series of onIncline calls which it does in the sandbox below since it's already running at 60fps.

Relevant code:

https://codesandbox.io/p/sandbox/amazing-borg-x3v9dr?file=%2Fsrc%2Findex.jsx%3A23%2C9-23%2C19

The cube starts at "perfLevel" 0 where it's red, then 1 where it's orange, then 2 where it's green - but then gets reset to red by the onFallback being called even though its only ever flipped and never flopped.

Suggested solution:

The onFallback shouldn't be called if all the latest changes have all been inclines or all declines - only if it's flip-flopping between an incline and a decline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant