You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to improve the performance of (bevy_spatial_boids. My version can be found here.
One thing I noticed when using RenderDoc was one pass had a lot of commands (60k+ for 15k boids):
One issue what the duplication of the mesh, which was easy enough. That doubled the FPS and halved the number of commands.
The next issue was the number of materials (randomly generated. So I changed that to a fixed number (12 by default), which tripled the FPS. However I'm seeing some unexpected things in RenderDoc depending on how I select the material:
selecting randomly, the number of commands barely changes (a tad below 30k) and most vkCmdDrawIndexed draw 1 or 2 instances
grouping by material when creating the entities, reduces the number of commands significantly, but the resulting number is proportional to the square of the number of materials (i.e. 288 for 12 materials + a fixed 16 for other stuff)
selecting the materials sequentially (mat[0], then mat[1], ... then mat[12], then mat[0] again, ...), reduces the number of commands even further, to be proportional to the number of materials (i.e. 24 for the material + the 16 mentioned above).
All three have the same performance (more or less at least, I didn't check if there is a percent points difference)
My expectation was that Bevy would sort and always use the name number of vkCmdDrawIndexed as the number of (mesh, materials) combinations (so in my case, 12). Isn't that supposed to be that way?
Is this expected than 1) has the same performance as the other 2 despite the number of vkCmdDrawIndexed? (maybe because the GPU driver/card does the sorting for us?)
Is the "square-of-the-number-of-combinations" in 2) expected as well?
Is there a recommended way to do batching? 3) looks ideal, but is this expected or just a quirk of the way Bevy is currently coded?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to improve the performance of (bevy_spatial_boids. My version can be found here.
One thing I noticed when using RenderDoc was one pass had a lot of commands (60k+ for 15k boids):
One issue what the duplication of the mesh, which was easy enough. That doubled the FPS and halved the number of commands.
The next issue was the number of materials (randomly generated. So I changed that to a fixed number (12 by default), which tripled the FPS. However I'm seeing some unexpected things in RenderDoc depending on how I select the material:
vkCmdDrawIndexed
draw 1 or 2 instancesAll three have the same performance (more or less at least, I didn't check if there is a percent points difference)
vkCmdDrawIndexed
as the number of(mesh, materials)
combinations (so in my case, 12). Isn't that supposed to be that way?vkCmdDrawIndexed
? (maybe because the GPU driver/card does the sorting for us?)Beta Was this translation helpful? Give feedback.
All reactions