PerformanceMonitor's onFallback
gets called when it's not flip-flopping
#1739
Labels
bug
Something isn't working
onFallback
gets called when it's not flip-flopping
#1739
three
version: 0.156.1@react-three/fiber
version: 8.14.3@react-three/drei
version: 9.86.3node
version: 20npm
(oryarn
) version: 9.6.7Problem 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 ofonIncline
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 declineThe text was updated successfully, but these errors were encountered: