KhronosGroup / MoltenVK

MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
Apache License 2.0
4.73k stars 411 forks source link

Improve tracking of need for Metal visibility buffer in Metal renderpasses #1256

Open billhollings opened 3 years ago

billhollings commented 3 years ago

The current logic around deciding whether a visibility buffer is needed is relatively crude. Currently, it is applied to all render passes in a Vulkan command buffer based on at least one occlusion query being present. A Metal renderpass needs a visibility buffer if a query is started either before it or inside it. For a command buffer with multiple Metal render passes, not all of them may need it.

Recommended logic:

billhollings commented 3 years ago

I performed some further analysis and experimentation. Additional requirements:

billhollings commented 3 years ago

Since a full solution appears to be necessarily complex, and the benefits of the improvement are unclear (assumed to be some type of undefined performance improvement), at this point, further work on this is being left until a definite need arises.