什么是“金属冲洗"?在SceneKit统计信息显示中? [英] What are "Metal Flush" in the SceneKit stats display?

查看:50
本文介绍了什么是“金属冲洗"?在SceneKit统计信息显示中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解决FPS下降的问题.我看到Metal Flushs占据了大部分渲染时间.那是好事吗?

I'm trying to troubleshoot drops in FPS. I see that Metal Flushes are what takes up most of the rendering time. Is that a good thing?

推荐答案

对此我不确定 ,因为Apple似乎没有记载金属冲洗"的确切含义,但是我将根据以前的OpenGL经验进行回答:

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

在由GPU驱动的应用程序的执行周期中,CPU会将数据推送到GPU,等待GPU完成对该数据的操作(同时可能还要执行其他工作),并且完成后,推送更多数据并请求更多操作.通常,刷新"意味着CPU正在等待GPU完成操作(刷新旧数据"),以便可以将更多数据推送到GPU.

During the execution cycle of a GPU-powered application, the CPU will push data to the GPU, wait for the GPU to finish operating on this data (possibly doing other work in the meantime), and as soon as the GPU is done, push more data and request more operations. Typically, "flushing" would mean that the CPU is waiting on the GPU to finish operations ("flushing out old data") so that it can push more data to the GPU.

因此,如果我的解释正确,那意味着金属刷新"将衡量CPU等待释放视频内存所花费的时间,以便它可以推送更多数据并向GPU请求操作.在那种情况下,它可能是好事也可能是坏事:

So, if my interpretation is correct, that would mean that "Metal flush" measures the time the CPU spends waiting on video memory to free up so it can push more data and request operations to the GPU. In that case, it could be a good thing or a bad thing:

CPU和GPU之间始终会有一些通信开销,因此,如果您的大部分渲染时间都由金属刷新"占用,则可能意味着您的应用程序运行速度足够快,以至于大部分延迟帧之间只是通信开销.在那种情况下,那将是一件好事.

There will always be some communication overhead between the CPU and the GPU, so if most of your rendering time is being taken up by "Metal Flush", it might mean that your application is just running fast enough that most of the delay between frames is just communications overhead. In that case, it would be a good thing.

另一方面,您可能会将大量数据推送到GPU,并且复制数据和处理数据所需的时间可能会导致延迟.在那种情况下,那将是一件坏事.

On the other hand, you might be pushing a lot of data to the GPU and the time needed to copy the data and process it might be causing delays. In that case, it would be a bad thing.

最后,重要的是要确保您的FPS始终很高.如果由于金属冲洗"而导致FPS下降,则您可能想尝试间隔数据传输-例如,将纹理存储在块中和/或使用较低分辨率的纹理可能会对此有所帮助.

In the end, the important thing here is to ensure your FPS is consistently high. If your FPS is dropping due to "Metal Flush", you might want to try to space out your data transfers - for instance, storing textures in chunks and/or using lower resolution textures would probably help with that.

这篇关于什么是“金属冲洗"?在SceneKit统计信息显示中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆