-
Notifications
You must be signed in to change notification settings - Fork 644
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
WebWorker backend support #5
Comments
Couldn't one just load gpu in the webworker? Done! |
As a general update to this enhancement, I think API-wise, maybe we should just return a Promise just like how we just return a Texture object anyway. To support graceful fallback, we could implement an async unrwraper to turn our different output types (Arrays, Promises, Textures) into Arrays. @robertleeplummerjr what you are describing requires this tho https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas It would actually improve the user experience for our normal GPU kernels by allowing JavaScript to execute something while awaiting for a response from GPU, But, WebWorkers also improve CPU performance which is something we could try and achieve too. |
I was more thinking just cpu fallback in webworker, but your recommendation is a touché to my angarde. |
Just chiming in to say I would love to be able to run GPU.js in a webworker on a GPU. Too bad only Firefox supports webgl in a webworker at this point https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas#Browser_compatibility |
agreed. I have a feeling that will be the case for only a short time. It is just too good of a feature. |
Is gpu.js usable in a web worker? |
Unit tests: gpu.js/test/features/offscreen-canvas.js Line 19 in 5397186
|
I believe this to be working. |
Use the WebWorker API to run the kernel on CPU cores.
Challenges:
The text was updated successfully, but these errors were encountered: