What is "Metal Flush" on a SceneKit statistics display?

I am trying to eliminate drops in FPS. I can see that Metal Flushes is what takes up most of the rendering time. It's good?

SceneKit statistics display

+6
source share
1 answer

I'm not sure about this, since Apple does not seem to have documented what exactly Metal Flush is anywhere, but I will answer based on previous experience with OpenGL:

During the execution cycle of the application running on the GPU, the CPU will push the data to the GPU, waiting for the GPU to finish working on this data (maybe another work will be done during this time), and as soon as the GPU will do more data and request more operations. Typically, flushing means that the CPU is waiting on the GPU to complete operations (flushing old data) so that it can send more data to the GPU.

So, if my interpretation is correct, this will mean that "Metal flush" measures the time it takes the processor to wait for video memory to free it so that it can push more data on the GPU and request operations. In this case, it can be good or bad:

There will always be some kind of communication overhead between the processor and the GPU, so if most of your rendering time is using β€œMetal Flush”, this may mean that your application is fast enough so that most of the delay between frames is just overhead. In that case, it would be good.

On the other hand, you can push a lot of data on the GPU and the time it takes to copy the data and process it can cause delays. In this case, it would be bad.

After all, it is important that your FPS is constantly high. If your FPS crashes due to "Metal Flush", you can try to hide your data transfers - for example, saving textures in pieces and / or using lower resolution textures will probably help with this.

+5
source

All Articles