Repository navigation
Add Threading guide and make RNWebGPU available on worklet runtimes - #510
Open
wcandillon wants to merge 2 commits into
Open
wcandillon wants to merge 2 commits into
wcandillon wants to merge 2 commits into
Conversation
Add a Threading page under Getting Started that explains the three runtimes (JS thread, UI runtime, dedicated worklet runtime), which one to pick, what must stay on the JS thread, how WebGPU objects cross into worklets, where promises settle, a complete worklet render loop that stops on unmount, and the thread-safety model. The Native APIs, Worklets, installWebGPU and related pages now defer to it instead of repeating the implicit-device-synchronization explanation. installWebGPU() now also installs the RNWebGPU global on the calling worklet runtime, so native helpers such as createVideoFrameFromNativeBuffer work from a frame processor as documented on the Vision Camera page. Also reword the React Three Fiber threading note, and fix the stale AsyncBuffer example comment about where async results settle.
Owner
Author
|
@copilot resolve the merge conflicts in this pull request |
…eo-p55un1 # Conflicts: # apps/docs/content/api/install-webgpu.mdx Co-authored-by: wcandillon <306134+wcandillon@users.noreply.github.com>
Resolved the conflict and merged |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive documentation on threading and WebGPU runtime selection, while also making the
RNWebGPUglobal available on worklet runtimes viainstallWebGPU().Key Changes
Documentation:
RNWebGPUinstallationImplementation:
installWebGPU()to install theRNWebGPUglobal on worklet runtimes, not justnavigator.gpuprovideGPUForInstall()to accept the fullRNWebGPUobject instead of just thegpupropertyRNWebGPUandgpuRNWebGPUobject toprovideGPUForInstall()Notable Details
The
RNWebGPUglobal provides native helper functions likecreateVideoFrameFromNativeBufferthat are needed on worklet runtimes. By making it available throughinstallWebGPU(), worklets can now access these helpers without workarounds. The implementation uses the existing Worklets serializer mechanism to pass the native object by reference across runtimes.https://claude.ai/code/session_01SKomALwiaZvnhAS2rDt1kN