Open douira opened 1 month ago
I've measured the cache hit ratios for some situations. Average over 100 frames (values eyeballed), limited to 150 fps, average world. The hit ratio will be better the higher the fps, but even with 30 fps the hit ratios were generally good.
not weighted by batch size (number of cached batches / total)
weighted by batch size (number of commands from cached batches / total)
I hope I found all the places where cache invalidation needs to happen, but that's something to look out for during review.
I get an improvement of around 7% by caching multi draw batches on each region. The margin is somewhat smaller when in motion, but often the batch can still be reused. The increase in memory use seems to be minimal.
If only one section in the region changed, only re-writing the command buffer starting at that section might bring an improvement of 50% on average for regions with block updates, but the metadata management for such partial buffer writes is somewhat complicated and may not be worth it if we're going to be changing this part of the renderer anyway.
dev
dev with this patch