-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add WIP WebGPU mode #8179
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
base: dev-2.0
Are you sure you want to change the base?
Add WIP WebGPU mode #8179
Conversation
This reverts commit 498bb83.
Framebuffer support on WebGPU renderer
@ksen0 because this splits tests into two steps, the regular tests and the webgpu tests, even though the webgpu ones aren't run, I think the change in test steps has made the required check not match up. If we go with self-hosted runners or Azure for WebGPU tests, we'll likely need to update the PR requirements. If we want to keep WebGPU tests off, we can either still update the requirements to match the test name here, or I can update this to match the old test step name. |
Is there a default addon export file for the WebGPU renderer that |
@limzykenneth that'd be this I think! p5.js/src/webgpu/p5.RendererWebGPU.js Lines 1926 to 1938 in d010b45
|
Actually I'll have to give this a tad more thought, since it needs more than just the webgpu renderer -- it also needs basically everything else included in the webgl export other than its renderer, e.g. Lines 19 to 37 in aa73cea
If I make a similar function for WebGPU that sets up all of those, it'd probably work but would double-add those addons if both WebGPU and WebGL are added I think? Do you think that's OK or should we add some way to detect when an addon function has already been called? It'd have to pay attention to what's passed in because p5.Graphics would possibly also need to call the same function but with different parameters. |
It would be nice if the call to The main thing I'm currently thinking may be a problem is the decoration feature which if the same addon is registered multiple times then it will also create duplicate decoration. The other thing is that since the addon function will be called multiple times, would it affect some of the internal initialization of the addon if that is the case? Calling |
This refactors
RendererGL
into two classes,Renderer3D
, and a subclassRendererGL
. It also introduces a newRendererWebGPU
that extendsRenderer3D
as well.No WebGPU code is bound by default. Currently it can be tested just by importing its addon module and setting it up, e.g. this test sketch using textures and framebuffers:
WebGPU test sketch source code
Notes
WEBGPU
mode, you need toawait createCanvas(w, h, WEBGPU)
await loadPixels()
andawait get()
imageLight()