-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
switch to WebGPU instead of Vulkan for 3D / 2D rendering. #1112
Conversation
…uff. next is memory (need to re-remember how all that works)
…ue -- much simpler.
…ng instead of complicating the values to be as dynamic as all that -- just need to pre-gather all the objects to be rendered first, get all their model matricies, and other per-object data, and then upload those as vertex per-instance data.. push constants sure are so much easier..
…Float32Matrix4 over 4 vector4s with proper interleaving.
…eration. can independently update bindings per group so that's good for textures -- definitely the way to go.
…0 which explains issues with buffers..
…t from init if uint16..
…w working on web!
…ebGPU is not available for 3D rendering
…release builds but has a truthy navigator.gpu for some reason
I verified that this works on all browsers on all platforms to the extent possible: Full support on:
2D backup support on:
Note that we will gradually enable support for the current 2D backup platforms as they develop sufficient support, but currently they do not have such (#1144). Additionally, I have verified that this works natively on macOS, Windows, Linux, iOS, and Android. Therefore, this is ready to be merged. |
Nice work! Can confirm it still works on my Debian Linux VM, and my Windows 10 VM. The macOS native version doesn't seem to spike my laptop fans any more, either, so that's great, too. (Detail: it doesn't spike my "cpu package gpu" power usage, which was, I think, the "smoking gun" on the fans.) |
@theclapp great news on the power usage on intel mac -- I had noticed on my intel mac that the vulkan version seemed to push the fans a lot. Could you also run this command:
on your linux vm and report the results here? I'm curious what the "backend type" says there, and what the limits are, etc. And you've tried examples/xyz on it and that all works? |
webgpuinfo output
And yes, the xyz demo seems to work, too. 🎉 |
Great, thank you for the information! |
you guys are kicking it !!! |
Thank you! |
question: "2D backup support on: Firefox on macOS, Windows, Linux, and Android SO does this mean that 2D works on Mac and IOS without having to turn on WebGPU support in the settings ? Quite curious , because it really matters to users. |
Yes, 2D works automatically on all platforms on which WebGPU is not yet supported. |
thanks @kkoreilly - will pull latest and give it a whirl. |
This mega-branch contains a new version of
vgpu
that works with WebGPU instead of vulkan.Overall WebGPU is much simpler and cleaner than vulkan, and, critically, works on the web.
The top-level
gpu
package contains the full implementation and supporting packages, replacingvgpu
and associated packages.gpudraw
replacesvdraw
and has an improved interface, updating thesystem.Drawer
interface used for basic 2D image compositing during rendering.This is not done yet but maybe @kkoreilly wants to make any comments on the gpudraw api at this point?
(Edit from @kkoreilly):
For GitHub purposes, this fixes #290, fixes #481, fixes #483, fixes #507, fixes #682, fixes #911, fixes #1018, fixes #1063, fixes #1101, fixes #1106, fixes #1115 (#507 and #682 are the primary issues)