Skip to content

fix(fiber): defer invalidation during root updates#3766

Open
raashish1601 wants to merge 1 commit into
pmndrs:masterfrom
raashish1601:fix/issue-3750-one-frame-desync
Open

fix(fiber): defer invalidation during root updates#3766
raashish1601 wants to merge 1 commit into
pmndrs:masterfrom
raashish1601:fix/issue-3750-one-frame-desync

Conversation

@raashish1601
Copy link
Copy Markdown

Summary

Fixes #3750.

  • Track in-flight root configure/render updates so invalidation is deferred until the update scope finishes.
  • Skip frame invalidation while a root update is actively mutating camera/object state.
  • Add regression coverage that updates camera and object props together and asserts no mixed old/new frame is observed.

Validation

  • corepack yarn prettier --check packages/fiber/src/core/loop.ts packages/fiber/src/core/renderer.tsx packages/fiber/src/core/store.ts packages/fiber/tests/renderer.test.tsx
  • corepack yarn eslint packages/fiber/src/core/loop.ts packages/fiber/src/core/renderer.tsx packages/fiber/src/core/store.ts packages/fiber/tests/renderer.test.tsx (exits 0; repository has pre-existing warnings)
  • corepack yarn jest packages/fiber/tests/renderer.test.tsx -t "updates camera and objects atomically during prop-driven scene updates" --runInBand
  • corepack yarn jest packages/fiber/tests/renderer.test.tsx --runInBand
  • corepack yarn typecheck
  • corepack yarn validate
  • git diff --check

@codesandbox-ci
Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 109555f:

Sandbox Source
example Configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reorienting camera & moving scene objects simultaneously produces extra out-of-sync frame

1 participant