Skip to content
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

Platforms: WebGPU support #65

Open
ca1773130n opened this issue Nov 6, 2023 · 9 comments
Open

Platforms: WebGPU support #65

ca1773130n opened this issue Nov 6, 2023 · 9 comments

Comments

@ca1773130n
Copy link

ca1773130n commented Nov 6, 2023

Thanks for sharing your great work.
I've been investigating about how to make this run on web browsers.

WebGL doesn't work as there is no compute shaders, so we need WebGPU backend.
Fortunately, Unity 2023 beta supports experimental WebGPU though some scripting for editor is needed to enable it.

For now I'm struggling with radix sort codes from FidelityFX, to make it work on WebGPU.
Here's some issues:

It seems like WGSL does not have a counterpart of GroupMemoryBarrierWithGroupSync().

  • It's being converted to just workgroupBarrier() which will slow down the sorting algorithm.
  • Also the shader compilation fails due to calling the function on a non-uniform control bound.
  • I couldn't succeeded to modify the original HLSL code to make it work.

wavebasic does not work. it produces an error like: invalid kernel index passed.

  • Metal backend works without it, so I can just comment it out but it could be much slower

There are working WebGPU implementations for 3D GS, so hopefully we could modify the current code to make it run without errors.

@aras-p aras-p changed the title WebGPU support Platforms: WebGPU support Nov 7, 2023
@aras-p
Copy link
Owner

aras-p commented Nov 7, 2023

Yeah all the shaders there right now are very much geared towards "let's assume we have a full modern shader capability", which WebGPU is still lacking in some aspects. I've spent zero effort to get this working on mobile or the web. Doable, but was not my focus.

@andybak
Copy link

andybak commented Nov 7, 2023

In my view there are going to by multiple, performant, web-native implementations (there already are). The interesting thing about this project is the Unity integration. Unity doesn't have any way to make use of WebGL or WebGPU and this projects remains the only way to use gsplats in conjunction with other Unity features.

@LifeIsStrange
Copy link

@ca1773130n Please don't hesitate to open/upvote an issue on https://github.com/gpuweb/gpuweb advocating for GroupMemoryBarrierWithGroupSync
Webgpu was a severe mistake reinventing the wheel from vulkan and giving the world a subpar api but it can still be improved in the future

@munrocket
Copy link

Are you sure that you need GroupMemoryBarrierWithGroupSync()? Seems DX doesn’t support it and all executed in lock-step.

@lucylucy27
Copy link

Hi, ca1773130n
Did you later successfully complete the support work for WebGPU?
Can this project correctly open and view PLY files in Chrome?
Thanks ~

@crazyzyz
Copy link

Hello, I want to try to use webgl package to generate in chrome now, but after chrome runs, there is a black screen. Through my check of browser developer tools, I find that there is no compute shader. Secondly, I find that the lack of compute shader is due to the lack of browser. I look forward to your reply, which is very important to me

@aras-p
Copy link
Owner

aras-p commented Oct 31, 2024

@crazyzyz WebGPU is not supported right now. This very issue is open for a reason!

@crazyzyz
Copy link

crazyzyz commented Nov 7, 2024

目前不支持 WebGPU。这个问题是有原因的!

Do you know why

@aras-p
Copy link
Owner

aras-p commented Nov 7, 2024

Do you know why

Because I have not implemented the right things needed for WebGPU support. The largest issue currently is probably lack of GPU sorting, since WebGPU (right now) does not have "wave/subgroup" shader operations.

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

No branches or pull requests

7 participants