-
-
Notifications
You must be signed in to change notification settings - Fork 35.9k
WebGPURenderer: Introduce dispatchWorkgroupsIndirect #31488
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
Are you sure you want to change the base?
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
The Could you include for |
The idea of calling it dispatchSize again also occurred to me, it's simply more general for everything that contains the size, whether array or buffer.
Please excuse me, sometimes I'm a little slow on the uptake. |
Hmm... I was referring to this: #31026 Maybe we can replace |
Related issue: #30982
This small extension allows you to control the dispatchSize with the GPU.
The benefit of GPU-side dispatchSize control lies in regressions.
Regressions aren't feasible on the GPU. They require multiple computes. Here's a clear example. My voxelizer. Here I'm voxelizing the BlackPearl. This is incredibly fast with compute shaders. Surface voxels are green. I also voxel the volume with yellow voxels ( important for buoyancy ), and the floodfill mechanism requires 52 iterations for this. With adaptive dispatchSize, the dispatchSize can always be adjusted to the remaining number of voxels.
This is also important for BVH if you want to do it with the GPU because they also require regressions.
The extension was pleasingly simple. You just have to follow the WebGPU guidelines:
No read/write in the same pass. However, it's logical that a compute shader can't compute its own dispatchSize. This requires a separate compute that runs with normal dispatch. Since this usually only requires a count of 1, it's definitely worth it for regressions. Like in Unreal and Unity