gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.35k stars 551 forks source link

Coalesce render encoders in Metal #3382

Open kvark opened 3 years ago

kvark commented 3 years ago

file:///private/var/folders/_s/63j0dt2d54l9vgyvl3v0n26r0000gn/T/com.apple.dt.XcodeBU5JKT/dota2.gputrace/: runtime: Bandwidth: Encoder "RenderCommandEncoder 0x60000b320460" and encoder "RenderCommandEncoder 0x60000b36c780" can be merged into one command encoder.

kvark commented 3 years ago

Looking closer, this is likely caused by this pattern:

vkCmdClearImage(...);
vkCmdBeginRenderPass(...) // Load/Store

I think we should be able to detect that and avoid pass closures.