feat: Render bundle, .with(pass) and .with(encoder) support#2200
feat: Render bundle, .with(pass) and .with(encoder) support#2200iwoplaza merged 22 commits intosoftware-mansion:mainfrom
Conversation
9118f45 to
532335f
Compare
|
Thanks for this! I think the example is fitting. Instancing would be a more fitting solution to the problem as you outlined, but it would be hard to make the objects more varied without making the example overly complex. The WebGPU samples went with a very similar example premise: https://webgpu.github.io/webgpu-samples/?q=bund&sample=renderBundles |
|
@jerzakm There are no more planned changes for that part of the codebase for the time being. We were stabilizing and adding better defaults, hence the changes, but |
fe5a105 to
ec38954
Compare
|
Sorry, I lied, I thought we already merged Indirect support 🙇♂️ |
0899d37 to
82b08c7
Compare
|
renderPipeline has quite a lot of duplication, should there maybe be something similar to |
|
I think this is kinda ready now for an initial review pass. Let me know if this is roughly correct and I'll work on some tests. There are two examples right now, one with my initial API and the other one that follows what you outline in that issue. That was mostly for testing, regardless of whether we're going to keep only one or both of these ways, only one example should remain. |
iwoplaza
left a comment
There was a problem hiding this comment.
The implementation looks really solid! I submitted a few suggestions based on recent updates in our APIs and capabilities.
As for the two APIs (.with(encoder) and .beginRenderBundleEncoder), I think we could keep them both for now and see which one feels more natural in the end.
…BindGroup and GPUbuffer
9a679c9 to
169a071
Compare
|
Thanks for addressing my comments! I guess the only thing left are tests, and we can merge. Thanks again for taking the time to work on this. |
Should I remove one of the examples? Are we going to merge this first and then do docs in another PR or something? |
Let's leave both examples in here. I think we can safely do docs in another PR, don't worry about it |
iwoplaza
left a comment
There was a problem hiding this comment.
Awesome! Thanks again for working on this. Just ensure the tests pass and let's merge it.
As a follow up to issue #2194 I started tinkering with render bundles in typeGPU. Code is probably mostly a throwaway - or maybe this or s imilar API could be a wrapper on lower level changes @iwoplaza outlined in #1826 .
Genuinely ignore the implementation code for now, but one thing I'd like feedback on is the example. I struggled to come up with a good one that wil DEFINITELY show off render bundle impact. I made a classic perlin noise terrain made out of cubes.
The terrain is always same size, just amount of cubes can be increased (density of cubes).
At some point, unless you are on a powerful machine the FPS will drop from 60 or whatever and that's when you can first see render bundle impact. For me, perf droped at 262k cubes:
Then I enable render bundles and get a few frames:

This is not a realistic scenario cause normally you'd just instance these but I wanted to show off draw call impact and perf gain.