Replies: 1 comment
-
Thinking about this some more, I'm considering using a uniform pool. This would still mean creating all of the bind groups for each uniform each frame. I was curious if there were any examples of uniform pools being used and after a bit of searching I found @kvark's baryon crate. It looks like the bind groups are created each frame there too. However, in response to a question asking how expensive bind group creation is, @cwfitzgerald suggests that making more than a handful of bind groups each frame should be avoided. Which leaves me uncertain on the merits or demerits of this approach. Is there a general consensus on whether this is a good or bad idea? |
Beta Was this translation helpful? Give feedback.
-
I want to upload N uniforms each frame and for various reasons need to create each of the uniform buffers on each frame. This is marked as “don’t do” in the wiki, which suggests using a single large buffer. Is there a way to do this without having to adhere to the minimum dynamic buffer offset size?
To give an example, I want to have an API that looks something like this:
In my mind I need to generate the vertices and transforms, create the buffers, the bind group and then draw those. The vertex buffer is easy to tightly pack but I don’t know if it’s possible to do so with a single uniform buffer.
Note, I’ve not profiled any of this so a uniform buffer with dynamic offsets and “gaps” in data might be absolutely fine. I’d just like to know what the other options are?
Beta Was this translation helpful? Give feedback.
All reactions