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.76k stars 419 forks source link

MoltenVK timestamp doesn't report timing precisely #2235

Open PENGUINLIONG opened 4 months ago

PENGUINLIONG commented 4 months ago

In the current implementation MoltenVK doesn't enforce a barrier when sampling a timestamp, in which case the timestamp may be sampled while some previous shaders are still running. As a result, the timings are totally unusable because they don't correctly represent the time spent on my dispatches. Is it possible to give it a YES to the withBarrier params?

https://github.com/KhronosGroup/MoltenVK/blob/bf097edc74ec3b6dfafdcd5a38d3ce14b11952d6/MoltenVK/MoltenVK/Commands/MVKCommandBuffer.mm#L1004-L1016