-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support for indirect draw calls for WebGPU #7777
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
Conversation
Nice! Couple of questions:
|
| Does this work in Safari? It works in my local WebKit browser using WebGPU, so I suspect when Safari with WebGPU is officially out, it will just work. |
It might be a good idea to add one or more |
/** | ||
* Retrieves the slot in the indirect buffer for a specific camera. | ||
* | ||
* @param {CameraComponent|null} camera - The camera component to retrieve the slot for, or null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know there are other places in the scene layer that import from the framework layers...but here's a new one!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'm stuck with it here. Camera is not public so I cannot use that, and don't see a good way around it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed all other comments, thanks!
Co-authored-by: Will Eastcott <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving assuming you're gonna add some example code or link to the example as an alternative.
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Implementation of indirect draw calls on WebGPU )both indexed and non indexed). The implementation uses a single storage buffer to store draw call parameters, allowing their batching into a small number of compute shaders to get the best performance, based on this.
Live example: https://engine-fwazdfd1j-playcanvas.vercel.app/#/compute/indirect-draw
Public API:
Graphics Device docs:



Mesh Instance docs:

example:
