Open cmhhelgeson opened 8 months ago
@toji did you have a demo doing some interesting things with indirect draws?
AFAIK this sample https://webgpu.github.io/webgpu-samples/?sample=bundleCulling uses indirect draw calls.
Yeah, the bundle culling code does use indirect draws, and I talk about their usage in that sample here: https://toji.dev/webgpu-best-practices/render-bundles#indirect-draws (Plus some additional optimization information here: https://toji.dev/webgpu-best-practices/indirect-draws) For what it's worth https://webgpu.github.io/webgpu-samples/?sample=metaballs also uses indirect draws, and is probably a more straightforward use case for them. They're both reasonably complex samples, though, and focused on techniques other than the indirect part.
It may be worthwhile to create a simpler sample focused specifically on indirect draws. It could be as basic as a variant of the spinning cube that uses an indirect draw instead of a traditional one, but that doesn't really touch on the "why" of indirect drawing. A sample with some simple generative geometry (like the metaballs, but ideally even more basic) would serve as a better illustration but it's easy for that to get overly complex fast.
Should there be an example that demonstrates best practices for using indirect draw calls, ala the renderBundles example? Or perhaps indirect draw calls could be an option in a separate sample?